Loading net/ethernet/eth.c +46 −50 Original line number Original line Diff line number Diff line Loading @@ -95,8 +95,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, saddr = dev->dev_addr; saddr = dev->dev_addr; memcpy(eth->h_source, saddr, dev->addr_len); memcpy(eth->h_source, saddr, dev->addr_len); if(daddr) if (daddr) { { memcpy(eth->h_dest, daddr, dev->addr_len); memcpy(eth->h_dest, daddr, dev->addr_len); return ETH_HLEN; return ETH_HLEN; } } Loading @@ -105,8 +104,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, * Anyway, the loopback-device should never use this function... * Anyway, the loopback-device should never use this function... */ */ if (dev->flags & (IFF_LOOPBACK|IFF_NOARP)) if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { { memset(eth->h_dest, 0, dev->addr_len); memset(eth->h_dest, 0, dev->addr_len); return ETH_HLEN; return ETH_HLEN; } } Loading @@ -129,8 +127,7 @@ int eth_rebuild_header(struct sk_buff *skb) struct ethhdr *eth = (struct ethhdr *)skb->data; struct ethhdr *eth = (struct ethhdr *)skb->data; struct net_device *dev = skb->dev; struct net_device *dev = skb->dev; switch (eth->h_proto) switch (eth->h_proto) { { #ifdef CONFIG_INET #ifdef CONFIG_INET case __constant_htons(ETH_P_IP): case __constant_htons(ETH_P_IP): return arp_find(eth->h_dest, skb); return arp_find(eth->h_dest, skb); Loading @@ -147,7 +144,6 @@ int eth_rebuild_header(struct sk_buff *skb) return 0; return 0; } } /** /** * eth_type_trans - determine the packet's protocol ID. * eth_type_trans - determine the packet's protocol ID. * @skb: received socket data * @skb: received socket data Loading Loading @@ -205,6 +201,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) */ */ return htons(ETH_P_802_2); return htons(ETH_P_802_2); } } EXPORT_SYMBOL(eth_type_trans); /** /** * eth_header_parse - extract hardware address from packet * eth_header_parse - extract hardware address from packet Loading Loading @@ -251,14 +248,13 @@ int eth_header_cache(struct neighbour *neigh, struct hh_cache *hh) * * * Called by Address Resolution module to notify changes in address. * Called by Address Resolution module to notify changes in address. */ */ void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr) void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char *haddr) { { memcpy(((u8 *) hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)), memcpy(((u8 *) hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)), haddr, dev->addr_len); haddr, dev->addr_len); } } EXPORT_SYMBOL(eth_type_trans); /** /** * eth_mac_addr - set new Ethernet hardware address * eth_mac_addr - set new Ethernet hardware address * @dev: network device * @dev: network device Loading Loading
net/ethernet/eth.c +46 −50 Original line number Original line Diff line number Diff line Loading @@ -95,8 +95,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, saddr = dev->dev_addr; saddr = dev->dev_addr; memcpy(eth->h_source, saddr, dev->addr_len); memcpy(eth->h_source, saddr, dev->addr_len); if(daddr) if (daddr) { { memcpy(eth->h_dest, daddr, dev->addr_len); memcpy(eth->h_dest, daddr, dev->addr_len); return ETH_HLEN; return ETH_HLEN; } } Loading @@ -105,8 +104,7 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, * Anyway, the loopback-device should never use this function... * Anyway, the loopback-device should never use this function... */ */ if (dev->flags & (IFF_LOOPBACK|IFF_NOARP)) if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) { { memset(eth->h_dest, 0, dev->addr_len); memset(eth->h_dest, 0, dev->addr_len); return ETH_HLEN; return ETH_HLEN; } } Loading @@ -129,8 +127,7 @@ int eth_rebuild_header(struct sk_buff *skb) struct ethhdr *eth = (struct ethhdr *)skb->data; struct ethhdr *eth = (struct ethhdr *)skb->data; struct net_device *dev = skb->dev; struct net_device *dev = skb->dev; switch (eth->h_proto) switch (eth->h_proto) { { #ifdef CONFIG_INET #ifdef CONFIG_INET case __constant_htons(ETH_P_IP): case __constant_htons(ETH_P_IP): return arp_find(eth->h_dest, skb); return arp_find(eth->h_dest, skb); Loading @@ -147,7 +144,6 @@ int eth_rebuild_header(struct sk_buff *skb) return 0; return 0; } } /** /** * eth_type_trans - determine the packet's protocol ID. * eth_type_trans - determine the packet's protocol ID. * @skb: received socket data * @skb: received socket data Loading Loading @@ -205,6 +201,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev) */ */ return htons(ETH_P_802_2); return htons(ETH_P_802_2); } } EXPORT_SYMBOL(eth_type_trans); /** /** * eth_header_parse - extract hardware address from packet * eth_header_parse - extract hardware address from packet Loading Loading @@ -251,14 +248,13 @@ int eth_header_cache(struct neighbour *neigh, struct hh_cache *hh) * * * Called by Address Resolution module to notify changes in address. * Called by Address Resolution module to notify changes in address. */ */ void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr) void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char *haddr) { { memcpy(((u8 *) hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)), memcpy(((u8 *) hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)), haddr, dev->addr_len); haddr, dev->addr_len); } } EXPORT_SYMBOL(eth_type_trans); /** /** * eth_mac_addr - set new Ethernet hardware address * eth_mac_addr - set new Ethernet hardware address * @dev: network device * @dev: network device Loading