Changeset a35b458 in mainline for uspace/srv/net/inetsrv/ndp.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/inetsrv/ndp.c

    r3061bc1 ra35b458  
    6868        inet_dgram_t dgram;
    6969        ndp_pdu_encode(packet, &dgram);
    70        
     70
    7171        inet_link_send_dgram6(link, packet->target_hw_addr, &dgram,
    7272            IP_PROTO_ICMPV6, INET6_HOP_LIMIT_MAX, 0);
    73        
     73
    7474        free(dgram.data);
    75        
     75
    7676        return EOK;
    7777}
     
    8686{
    8787        log_msg(LOG_DEFAULT, LVL_DEBUG, "ndp_received()");
    88        
     88
    8989        ndp_packet_t packet;
    9090        errno_t rc = ndp_pdu_decode(dgram, &packet);
    9191        if (rc != EOK)
    9292                return rc;
    93        
     93
    9494        inet_addr_t sender;
    9595        inet_addr_set6(packet.sender_proto_addr, &sender);
    96        
     96
    9797        inet_addr_t target;
    9898        inet_addr_set6(packet.target_proto_addr, &target);
    99        
     99
    100100        inet_addrobj_t *laddr;
    101        
     101
    102102        log_msg(LOG_DEFAULT, LVL_DEBUG, "NDP PDU decoded; opcode: %d",
    103103            packet.opcode);
    104        
     104
    105105        switch (packet.opcode) {
    106106        case ICMPV6_NEIGHBOUR_SOLICITATION:
     
    111111                        if (rc != EOK)
    112112                                return rc;
    113                        
     113
    114114                        ndp_packet_t reply;
    115                        
     115
    116116                        reply.opcode = ICMPV6_NEIGHBOUR_ADVERTISEMENT;
    117117                        addr48(laddr->ilink->mac, reply.sender_hw_addr);
     
    119119                        addr48(packet.sender_hw_addr, reply.target_hw_addr);
    120120                        addr128(packet.sender_proto_addr, reply.target_proto_addr);
    121                        
     121
    122122                        ndp_send_packet(laddr->ilink, &reply);
    123123                }
    124                
     124
    125125                break;
    126126        case ICMPV6_NEIGHBOUR_ADVERTISEMENT:
     
    129129                        return ntrans_add(packet.sender_proto_addr,
    130130                            packet.sender_hw_addr);
    131                
     131
    132132                break;
    133133        case ICMPV6_ROUTER_ADVERTISEMENT:
     
    136136                return ENOTSUP;
    137137        }
    138        
     138
    139139        return EOK;
    140140}
     
    159159                return EOK;
    160160        }
    161        
     161
    162162        errno_t rc = ntrans_lookup(ip_addr, mac_addr);
    163163        if (rc == EOK)
    164164                return EOK;
    165        
     165
    166166        ndp_packet_t packet;
    167        
     167
    168168        packet.opcode = ICMPV6_NEIGHBOUR_SOLICITATION;
    169169        addr48(ilink->mac, packet.sender_hw_addr);
     
    172172        addr48_solicited_node(ip_addr, packet.target_hw_addr);
    173173        ndp_solicited_node_ip(ip_addr, packet.target_proto_addr);
    174        
     174
    175175        rc = ndp_send_packet(ilink, &packet);
    176176        if (rc != EOK)
    177177                return rc;
    178        
     178
    179179        (void) ntrans_wait_timeout(NDP_REQUEST_TIMEOUT);
    180        
     180
    181181        return ntrans_lookup(ip_addr, mac_addr);
    182182}
Note: See TracChangeset for help on using the changeset viewer.