Changeset a35b458 in mainline for uspace/srv/net/ethip/arp.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/ethip/arp.c

    r3061bc1 ra35b458  
    5555{
    5656        log_msg(LOG_DEFAULT, LVL_DEBUG, "arp_received()");
    57        
     57
    5858        arp_eth_packet_t packet;
    5959        errno_t rc = arp_pdu_decode(frame->data, frame->size, &packet);
    6060        if (rc != EOK)
    6161                return;
    62        
     62
    6363        log_msg(LOG_DEFAULT, LVL_DEBUG, "ARP PDU decoded, opcode=%d, tpa=%x",
    6464            packet.opcode, packet.target_proto_addr);
    65        
     65
    6666        inet_addr_t addr;
    6767        inet_addr_set(packet.target_proto_addr, &addr);
    68        
     68
    6969        ethip_link_addr_t *laddr = ethip_nic_addr_find(nic, &addr);
    7070        if (laddr == NULL)
    7171                return;
    72        
     72
    7373        addr32_t laddr_v4;
    7474        ip_ver_t laddr_ver = inet_addr_get(&laddr->addr, &laddr_v4, NULL);
    7575        if (laddr_ver != ip_v4)
    7676                return;
    77        
     77
    7878        log_msg(LOG_DEFAULT, LVL_DEBUG, "Request/reply to my address");
    79        
     79
    8080        (void) atrans_add(packet.sender_proto_addr,
    8181            packet.sender_hw_addr);
    82        
     82
    8383        if (packet.opcode == aop_request) {
    8484                arp_eth_packet_t reply;
    85                
     85
    8686                reply.opcode = aop_reply;
    8787                addr48(nic->mac_addr, reply.sender_hw_addr);
     
    8989                addr48(packet.sender_hw_addr, reply.target_hw_addr);
    9090                reply.target_proto_addr = packet.sender_proto_addr;
    91                
     91
    9292                arp_send_packet(nic, &reply);
    9393        }
     
    106106        if (rc == EOK)
    107107                return EOK;
    108        
     108
    109109        arp_eth_packet_t packet;
    110        
     110
    111111        packet.opcode = aop_request;
    112112        addr48(nic->mac_addr, packet.sender_hw_addr);
     
    114114        addr48(addr48_broadcast, packet.target_hw_addr);
    115115        packet.target_proto_addr = ip_addr;
    116        
     116
    117117        rc = arp_send_packet(nic, &packet);
    118118        if (rc != EOK)
    119119                return rc;
    120        
     120
    121121        return atrans_lookup_timeout(ip_addr, ARP_REQUEST_TIMEOUT, mac_addr);
    122122}
Note: See TracChangeset for help on using the changeset viewer.