diff options
-rw-r--r-- | drivers/firewire/net.c | 13 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_net.c | 33 | ||||
-rw-r--r-- | drivers/media/dvb-core/dvb_net.c | 1 | ||||
-rw-r--r-- | drivers/net/arcnet/arcnet.c | 55 | ||||
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 1 | ||||
-rw-r--r-- | drivers/net/macvlan.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 1 | ||||
-rw-r--r-- | include/linux/etherdevice.h | 1 | ||||
-rw-r--r-- | include/linux/netdevice.h | 12 | ||||
-rw-r--r-- | net/802/fc.c | 21 | ||||
-rw-r--r-- | net/802/fddi.c | 26 | ||||
-rw-r--r-- | net/802/hippi.c | 28 | ||||
-rw-r--r-- | net/8021q/vlan_dev.c | 35 | ||||
-rw-r--r-- | net/ethernet/eth.c | 34 | ||||
-rw-r--r-- | net/netrom/nr_dev.c | 31 | ||||
-rw-r--r-- | net/rose/rose_dev.c | 14 |
16 files changed, 1 insertions, 306 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 2c68da1ceeee..f4ea80d602f7 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
@@ -237,18 +237,6 @@ static int fwnet_header_create(struct sk_buff *skb, struct net_device *net, | |||
237 | return -net->hard_header_len; | 237 | return -net->hard_header_len; |
238 | } | 238 | } |
239 | 239 | ||
240 | static int fwnet_header_rebuild(struct sk_buff *skb) | ||
241 | { | ||
242 | struct fwnet_header *h = (struct fwnet_header *)skb->data; | ||
243 | |||
244 | if (get_unaligned_be16(&h->h_proto) == ETH_P_IP) | ||
245 | return arp_find((unsigned char *)&h->h_dest, skb); | ||
246 | |||
247 | dev_notice(&skb->dev->dev, "unable to resolve type %04x addresses\n", | ||
248 | be16_to_cpu(h->h_proto)); | ||
249 | return 0; | ||
250 | } | ||
251 | |||
252 | static int fwnet_header_cache(const struct neighbour *neigh, | 240 | static int fwnet_header_cache(const struct neighbour *neigh, |
253 | struct hh_cache *hh, __be16 type) | 241 | struct hh_cache *hh, __be16 type) |
254 | { | 242 | { |
@@ -282,7 +270,6 @@ static int fwnet_header_parse(const struct sk_buff *skb, unsigned char *haddr) | |||
282 | 270 | ||
283 | static const struct header_ops fwnet_header_ops = { | 271 | static const struct header_ops fwnet_header_ops = { |
284 | .create = fwnet_header_create, | 272 | .create = fwnet_header_create, |
285 | .rebuild = fwnet_header_rebuild, | ||
286 | .cache = fwnet_header_cache, | 273 | .cache = fwnet_header_cache, |
287 | .cache_update = fwnet_header_cache_update, | 274 | .cache_update = fwnet_header_cache_update, |
288 | .parse = fwnet_header_parse, | 275 | .parse = fwnet_header_parse, |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 94affa5e6f28..546b7e81161d 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -1951,38 +1951,6 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev, | |||
1951 | return len; | 1951 | return len; |
1952 | } | 1952 | } |
1953 | 1953 | ||
1954 | /* We don't need to send arp, because we have point-to-point connections. */ | ||
1955 | static int | ||
1956 | isdn_net_rebuild_header(struct sk_buff *skb) | ||
1957 | { | ||
1958 | struct net_device *dev = skb->dev; | ||
1959 | isdn_net_local *lp = netdev_priv(dev); | ||
1960 | int ret = 0; | ||
1961 | |||
1962 | if (lp->p_encap == ISDN_NET_ENCAP_ETHER) { | ||
1963 | struct ethhdr *eth = (struct ethhdr *) skb->data; | ||
1964 | |||
1965 | /* | ||
1966 | * Only ARP/IP is currently supported | ||
1967 | */ | ||
1968 | |||
1969 | if (eth->h_proto != htons(ETH_P_IP)) { | ||
1970 | printk(KERN_WARNING | ||
1971 | "isdn_net: %s don't know how to resolve type %d addresses?\n", | ||
1972 | dev->name, (int) eth->h_proto); | ||
1973 | memcpy(eth->h_source, dev->dev_addr, dev->addr_len); | ||
1974 | return 0; | ||
1975 | } | ||
1976 | /* | ||
1977 | * Try to get ARP to resolve the header. | ||
1978 | */ | ||
1979 | #ifdef CONFIG_INET | ||
1980 | ret = arp_find(eth->h_dest, skb); | ||
1981 | #endif | ||
1982 | } | ||
1983 | return ret; | ||
1984 | } | ||
1985 | |||
1986 | static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh, | 1954 | static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh, |
1987 | __be16 type) | 1955 | __be16 type) |
1988 | { | 1956 | { |
@@ -2005,7 +1973,6 @@ static void isdn_header_cache_update(struct hh_cache *hh, | |||
2005 | 1973 | ||
2006 | static const struct header_ops isdn_header_ops = { | 1974 | static const struct header_ops isdn_header_ops = { |
2007 | .create = isdn_net_header, | 1975 | .create = isdn_net_header, |
2008 | .rebuild = isdn_net_rebuild_header, | ||
2009 | .cache = isdn_header_cache, | 1976 | .cache = isdn_header_cache, |
2010 | .cache_update = isdn_header_cache_update, | 1977 | .cache_update = isdn_header_cache_update, |
2011 | }; | 1978 | }; |
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c index 686d3277dad1..4a77cb02dffc 100644 --- a/drivers/media/dvb-core/dvb_net.c +++ b/drivers/media/dvb-core/dvb_net.c | |||
@@ -1190,7 +1190,6 @@ static int dvb_net_stop(struct net_device *dev) | |||
1190 | static const struct header_ops dvb_header_ops = { | 1190 | static const struct header_ops dvb_header_ops = { |
1191 | .create = eth_header, | 1191 | .create = eth_header, |
1192 | .parse = eth_header_parse, | 1192 | .parse = eth_header_parse, |
1193 | .rebuild = eth_rebuild_header, | ||
1194 | }; | 1193 | }; |
1195 | 1194 | ||
1196 | 1195 | ||
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index 09de683c167e..10f71c732b59 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -104,7 +104,6 @@ EXPORT_SYMBOL(arcnet_timeout); | |||
104 | static int arcnet_header(struct sk_buff *skb, struct net_device *dev, | 104 | static int arcnet_header(struct sk_buff *skb, struct net_device *dev, |
105 | unsigned short type, const void *daddr, | 105 | unsigned short type, const void *daddr, |
106 | const void *saddr, unsigned len); | 106 | const void *saddr, unsigned len); |
107 | static int arcnet_rebuild_header(struct sk_buff *skb); | ||
108 | static int go_tx(struct net_device *dev); | 107 | static int go_tx(struct net_device *dev); |
109 | 108 | ||
110 | static int debug = ARCNET_DEBUG; | 109 | static int debug = ARCNET_DEBUG; |
@@ -312,7 +311,6 @@ static int choose_mtu(void) | |||
312 | 311 | ||
313 | static const struct header_ops arcnet_header_ops = { | 312 | static const struct header_ops arcnet_header_ops = { |
314 | .create = arcnet_header, | 313 | .create = arcnet_header, |
315 | .rebuild = arcnet_rebuild_header, | ||
316 | }; | 314 | }; |
317 | 315 | ||
318 | static const struct net_device_ops arcnet_netdev_ops = { | 316 | static const struct net_device_ops arcnet_netdev_ops = { |
@@ -538,59 +536,6 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev, | |||
538 | return proto->build_header(skb, dev, type, _daddr); | 536 | return proto->build_header(skb, dev, type, _daddr); |
539 | } | 537 | } |
540 | 538 | ||
541 | |||
542 | /* | ||
543 | * Rebuild the ARCnet hard header. This is called after an ARP (or in the | ||
544 | * future other address resolution) has completed on this sk_buff. We now | ||
545 | * let ARP fill in the destination field. | ||
546 | */ | ||
547 | static int arcnet_rebuild_header(struct sk_buff *skb) | ||
548 | { | ||
549 | struct net_device *dev = skb->dev; | ||
550 | struct arcnet_local *lp = netdev_priv(dev); | ||
551 | int status = 0; /* default is failure */ | ||
552 | unsigned short type; | ||
553 | uint8_t daddr=0; | ||
554 | struct ArcProto *proto; | ||
555 | /* | ||
556 | * XXX: Why not use skb->mac_len? | ||
557 | */ | ||
558 | if (skb->network_header - skb->mac_header != 2) { | ||
559 | BUGMSG(D_NORMAL, | ||
560 | "rebuild_header: shouldn't be here! (hdrsize=%d)\n", | ||
561 | (int)(skb->network_header - skb->mac_header)); | ||
562 | return 0; | ||
563 | } | ||
564 | type = *(uint16_t *) skb_pull(skb, 2); | ||
565 | BUGMSG(D_DURING, "rebuild header for protocol %Xh\n", type); | ||
566 | |||
567 | if (type == ETH_P_IP) { | ||
568 | #ifdef CONFIG_INET | ||
569 | BUGMSG(D_DURING, "rebuild header for ethernet protocol %Xh\n", type); | ||
570 | status = arp_find(&daddr, skb) ? 1 : 0; | ||
571 | BUGMSG(D_DURING, " rebuilt: dest is %d; protocol %Xh\n", | ||
572 | daddr, type); | ||
573 | #endif | ||
574 | } else { | ||
575 | BUGMSG(D_NORMAL, | ||
576 | "I don't understand ethernet protocol %Xh addresses!\n", type); | ||
577 | dev->stats.tx_errors++; | ||
578 | dev->stats.tx_aborted_errors++; | ||
579 | } | ||
580 | |||
581 | /* if we couldn't resolve the address... give up. */ | ||
582 | if (!status) | ||
583 | return 0; | ||
584 | |||
585 | /* add the _real_ header this time! */ | ||
586 | proto = arc_proto_map[lp->default_proto[daddr]]; | ||
587 | proto->build_header(skb, dev, type, daddr); | ||
588 | |||
589 | return 1; /* success */ | ||
590 | } | ||
591 | |||
592 | |||
593 | |||
594 | /* Called by the kernel in order to transmit a packet. */ | 539 | /* Called by the kernel in order to transmit a packet. */ |
595 | netdev_tx_t arcnet_send_packet(struct sk_buff *skb, | 540 | netdev_tx_t arcnet_send_packet(struct sk_buff *skb, |
596 | struct net_device *dev) | 541 | struct net_device *dev) |
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 4f4099d5603d..2950c3780230 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -336,7 +336,6 @@ static int ipvlan_hard_header(struct sk_buff *skb, struct net_device *dev, | |||
336 | 336 | ||
337 | static const struct header_ops ipvlan_header_ops = { | 337 | static const struct header_ops ipvlan_header_ops = { |
338 | .create = ipvlan_hard_header, | 338 | .create = ipvlan_hard_header, |
339 | .rebuild = eth_rebuild_header, | ||
340 | .parse = eth_header_parse, | 339 | .parse = eth_header_parse, |
341 | .cache = eth_header_cache, | 340 | .cache = eth_header_cache, |
342 | .cache_update = eth_header_cache_update, | 341 | .cache_update = eth_header_cache_update, |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 1df38bdae2ee..b5e3320ca506 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -550,7 +550,6 @@ static int macvlan_hard_header(struct sk_buff *skb, struct net_device *dev, | |||
550 | 550 | ||
551 | static const struct header_ops macvlan_hard_header_ops = { | 551 | static const struct header_ops macvlan_hard_header_ops = { |
552 | .create = macvlan_hard_header, | 552 | .create = macvlan_hard_header, |
553 | .rebuild = eth_rebuild_header, | ||
554 | .parse = eth_header_parse, | 553 | .parse = eth_header_parse, |
555 | .cache = eth_header_cache, | 554 | .cache = eth_header_cache, |
556 | .cache_update = eth_header_cache_update, | 555 | .cache_update = eth_header_cache_update, |
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 52919ad42726..8f9f3e9fbfce 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -798,7 +798,6 @@ static void prism2_tx_timeout(struct net_device *dev) | |||
798 | 798 | ||
799 | const struct header_ops hostap_80211_ops = { | 799 | const struct header_ops hostap_80211_ops = { |
800 | .create = eth_header, | 800 | .create = eth_header, |
801 | .rebuild = eth_rebuild_header, | ||
802 | .cache = eth_header_cache, | 801 | .cache = eth_header_cache, |
803 | .cache_update = eth_header_cache_update, | 802 | .cache_update = eth_header_cache_update, |
804 | .parse = hostap_80211_header_parse, | 803 | .parse = hostap_80211_header_parse, |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 1d869d185a0d..606563ef8a72 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -35,7 +35,6 @@ extern const struct header_ops eth_header_ops; | |||
35 | 35 | ||
36 | int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, | 36 | int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, |
37 | const void *daddr, const void *saddr, unsigned len); | 37 | const void *daddr, const void *saddr, unsigned len); |
38 | int eth_rebuild_header(struct sk_buff *skb); | ||
39 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); | 38 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); |
40 | int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, | 39 | int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, |
41 | __be16 type); | 40 | __be16 type); |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5897b4ea5a3f..2007f3b44d05 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -261,7 +261,6 @@ struct header_ops { | |||
261 | unsigned short type, const void *daddr, | 261 | unsigned short type, const void *daddr, |
262 | const void *saddr, unsigned int len); | 262 | const void *saddr, unsigned int len); |
263 | int (*parse)(const struct sk_buff *skb, unsigned char *haddr); | 263 | int (*parse)(const struct sk_buff *skb, unsigned char *haddr); |
264 | int (*rebuild)(struct sk_buff *skb); | ||
265 | int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type); | 264 | int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type); |
266 | void (*cache_update)(struct hh_cache *hh, | 265 | void (*cache_update)(struct hh_cache *hh, |
267 | const struct net_device *dev, | 266 | const struct net_device *dev, |
@@ -1346,7 +1345,7 @@ enum netdev_priv_flags { | |||
1346 | * if one wants to override the ndo_*() functions | 1345 | * if one wants to override the ndo_*() functions |
1347 | * @ethtool_ops: Management operations | 1346 | * @ethtool_ops: Management operations |
1348 | * @fwd_ops: Management operations | 1347 | * @fwd_ops: Management operations |
1349 | * @header_ops: Includes callbacks for creating,parsing,rebuilding,etc | 1348 | * @header_ops: Includes callbacks for creating,parsing,caching,etc |
1350 | * of Layer 2 headers. | 1349 | * of Layer 2 headers. |
1351 | * | 1350 | * |
1352 | * @flags: Interface flags (a la BSD) | 1351 | * @flags: Interface flags (a la BSD) |
@@ -2399,15 +2398,6 @@ static inline int dev_parse_header(const struct sk_buff *skb, | |||
2399 | return dev->header_ops->parse(skb, haddr); | 2398 | return dev->header_ops->parse(skb, haddr); |
2400 | } | 2399 | } |
2401 | 2400 | ||
2402 | static inline int dev_rebuild_header(struct sk_buff *skb) | ||
2403 | { | ||
2404 | const struct net_device *dev = skb->dev; | ||
2405 | |||
2406 | if (!dev->header_ops || !dev->header_ops->rebuild) | ||
2407 | return 0; | ||
2408 | return dev->header_ops->rebuild(skb); | ||
2409 | } | ||
2410 | |||
2411 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); | 2401 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); |
2412 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); | 2402 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); |
2413 | static inline int unregister_gifconf(unsigned int family) | 2403 | static inline int unregister_gifconf(unsigned int family) |
diff --git a/net/802/fc.c b/net/802/fc.c index 7c174b6750cd..7b9219022418 100644 --- a/net/802/fc.c +++ b/net/802/fc.c | |||
@@ -75,29 +75,8 @@ static int fc_header(struct sk_buff *skb, struct net_device *dev, | |||
75 | return -hdr_len; | 75 | return -hdr_len; |
76 | } | 76 | } |
77 | 77 | ||
78 | /* | ||
79 | * A neighbour discovery of some species (eg arp) has completed. We | ||
80 | * can now send the packet. | ||
81 | */ | ||
82 | |||
83 | static int fc_rebuild_header(struct sk_buff *skb) | ||
84 | { | ||
85 | #ifdef CONFIG_INET | ||
86 | struct fch_hdr *fch=(struct fch_hdr *)skb->data; | ||
87 | struct fcllc *fcllc=(struct fcllc *)(skb->data+sizeof(struct fch_hdr)); | ||
88 | if(fcllc->ethertype != htons(ETH_P_IP)) { | ||
89 | printk("fc_rebuild_header: Don't know how to resolve type %04X addresses ?\n", ntohs(fcllc->ethertype)); | ||
90 | return 0; | ||
91 | } | ||
92 | return arp_find(fch->daddr, skb); | ||
93 | #else | ||
94 | return 0; | ||
95 | #endif | ||
96 | } | ||
97 | |||
98 | static const struct header_ops fc_header_ops = { | 78 | static const struct header_ops fc_header_ops = { |
99 | .create = fc_header, | 79 | .create = fc_header, |
100 | .rebuild = fc_rebuild_header, | ||
101 | }; | 80 | }; |
102 | 81 | ||
103 | static void fc_setup(struct net_device *dev) | 82 | static void fc_setup(struct net_device *dev) |
diff --git a/net/802/fddi.c b/net/802/fddi.c index 59e7346f1193..7d3a0af954e8 100644 --- a/net/802/fddi.c +++ b/net/802/fddi.c | |||
@@ -87,31 +87,6 @@ static int fddi_header(struct sk_buff *skb, struct net_device *dev, | |||
87 | return -hl; | 87 | return -hl; |
88 | } | 88 | } |
89 | 89 | ||
90 | |||
91 | /* | ||
92 | * Rebuild the FDDI MAC header. This is called after an ARP | ||
93 | * (or in future other address resolution) has completed on | ||
94 | * this sk_buff. We now let ARP fill in the other fields. | ||
95 | */ | ||
96 | |||
97 | static int fddi_rebuild_header(struct sk_buff *skb) | ||
98 | { | ||
99 | struct fddihdr *fddi = (struct fddihdr *)skb->data; | ||
100 | |||
101 | #ifdef CONFIG_INET | ||
102 | if (fddi->hdr.llc_snap.ethertype == htons(ETH_P_IP)) | ||
103 | /* Try to get ARP to resolve the header and fill destination address */ | ||
104 | return arp_find(fddi->daddr, skb); | ||
105 | else | ||
106 | #endif | ||
107 | { | ||
108 | printk("%s: Don't know how to resolve type %04X addresses.\n", | ||
109 | skb->dev->name, ntohs(fddi->hdr.llc_snap.ethertype)); | ||
110 | return 0; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | |||
115 | /* | 90 | /* |
116 | * Determine the packet's protocol ID and fill in skb fields. | 91 | * Determine the packet's protocol ID and fill in skb fields. |
117 | * This routine is called before an incoming packet is passed | 92 | * This routine is called before an incoming packet is passed |
@@ -177,7 +152,6 @@ EXPORT_SYMBOL(fddi_change_mtu); | |||
177 | 152 | ||
178 | static const struct header_ops fddi_header_ops = { | 153 | static const struct header_ops fddi_header_ops = { |
179 | .create = fddi_header, | 154 | .create = fddi_header, |
180 | .rebuild = fddi_rebuild_header, | ||
181 | }; | 155 | }; |
182 | 156 | ||
183 | 157 | ||
diff --git a/net/802/hippi.c b/net/802/hippi.c index 2e03f8259dd5..ade1a52cdcff 100644 --- a/net/802/hippi.c +++ b/net/802/hippi.c | |||
@@ -91,33 +91,6 @@ static int hippi_header(struct sk_buff *skb, struct net_device *dev, | |||
91 | 91 | ||
92 | 92 | ||
93 | /* | 93 | /* |
94 | * Rebuild the HIPPI MAC header. This is called after an ARP has | ||
95 | * completed on this sk_buff. We now let ARP fill in the other fields. | ||
96 | */ | ||
97 | |||
98 | static int hippi_rebuild_header(struct sk_buff *skb) | ||
99 | { | ||
100 | struct hippi_hdr *hip = (struct hippi_hdr *)skb->data; | ||
101 | |||
102 | /* | ||
103 | * Only IP is currently supported | ||
104 | */ | ||
105 | |||
106 | if(hip->snap.ethertype != htons(ETH_P_IP)) | ||
107 | { | ||
108 | printk(KERN_DEBUG "%s: unable to resolve type %X addresses.\n",skb->dev->name,ntohs(hip->snap.ethertype)); | ||
109 | return 0; | ||
110 | } | ||
111 | |||
112 | /* | ||
113 | * We don't support dynamic ARP on HIPPI, but we use the ARP | ||
114 | * static ARP tables to hold the I-FIELDs. | ||
115 | */ | ||
116 | return arp_find(hip->le.daddr, skb); | ||
117 | } | ||
118 | |||
119 | |||
120 | /* | ||
121 | * Determine the packet's protocol ID. | 94 | * Determine the packet's protocol ID. |
122 | */ | 95 | */ |
123 | 96 | ||
@@ -186,7 +159,6 @@ EXPORT_SYMBOL(hippi_neigh_setup_dev); | |||
186 | 159 | ||
187 | static const struct header_ops hippi_header_ops = { | 160 | static const struct header_ops hippi_header_ops = { |
188 | .create = hippi_header, | 161 | .create = hippi_header, |
189 | .rebuild = hippi_rebuild_header, | ||
190 | }; | 162 | }; |
191 | 163 | ||
192 | 164 | ||
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 118956448cf6..1dcfec8b49f3 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -37,39 +37,6 @@ | |||
37 | #include <linux/netpoll.h> | 37 | #include <linux/netpoll.h> |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Rebuild the Ethernet MAC header. This is called after an ARP | ||
41 | * (or in future other address resolution) has completed on this | ||
42 | * sk_buff. We now let ARP fill in the other fields. | ||
43 | * | ||
44 | * This routine CANNOT use cached dst->neigh! | ||
45 | * Really, it is used only when dst->neigh is wrong. | ||
46 | * | ||
47 | * TODO: This needs a checkup, I'm ignorant here. --BLG | ||
48 | */ | ||
49 | static int vlan_dev_rebuild_header(struct sk_buff *skb) | ||
50 | { | ||
51 | struct net_device *dev = skb->dev; | ||
52 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); | ||
53 | |||
54 | switch (veth->h_vlan_encapsulated_proto) { | ||
55 | #ifdef CONFIG_INET | ||
56 | case htons(ETH_P_IP): | ||
57 | |||
58 | /* TODO: Confirm this will work with VLAN headers... */ | ||
59 | return arp_find(veth->h_dest, skb); | ||
60 | #endif | ||
61 | default: | ||
62 | pr_debug("%s: unable to resolve type %X addresses\n", | ||
63 | dev->name, ntohs(veth->h_vlan_encapsulated_proto)); | ||
64 | |||
65 | ether_addr_copy(veth->h_source, dev->dev_addr); | ||
66 | break; | ||
67 | } | ||
68 | |||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | /* | ||
73 | * Create the VLAN header for an arbitrary protocol layer | 40 | * Create the VLAN header for an arbitrary protocol layer |
74 | * | 41 | * |
75 | * saddr=NULL means use device source address | 42 | * saddr=NULL means use device source address |
@@ -534,7 +501,6 @@ static int vlan_dev_get_lock_subclass(struct net_device *dev) | |||
534 | 501 | ||
535 | static const struct header_ops vlan_header_ops = { | 502 | static const struct header_ops vlan_header_ops = { |
536 | .create = vlan_dev_hard_header, | 503 | .create = vlan_dev_hard_header, |
537 | .rebuild = vlan_dev_rebuild_header, | ||
538 | .parse = eth_header_parse, | 504 | .parse = eth_header_parse, |
539 | }; | 505 | }; |
540 | 506 | ||
@@ -554,7 +520,6 @@ static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *dev | |||
554 | 520 | ||
555 | static const struct header_ops vlan_passthru_header_ops = { | 521 | static const struct header_ops vlan_passthru_header_ops = { |
556 | .create = vlan_passthru_hard_header, | 522 | .create = vlan_passthru_hard_header, |
557 | .rebuild = dev_rebuild_header, | ||
558 | .parse = eth_header_parse, | 523 | .parse = eth_header_parse, |
559 | }; | 524 | }; |
560 | 525 | ||
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 238f38d21641..8dbdf6c910b7 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -113,39 +113,6 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, | |||
113 | EXPORT_SYMBOL(eth_header); | 113 | EXPORT_SYMBOL(eth_header); |
114 | 114 | ||
115 | /** | 115 | /** |
116 | * eth_rebuild_header- rebuild the Ethernet MAC header. | ||
117 | * @skb: socket buffer to update | ||
118 | * | ||
119 | * This is called after an ARP or IPV6 ndisc it's resolution on this | ||
120 | * sk_buff. We now let protocol (ARP) fill in the other fields. | ||
121 | * | ||
122 | * This routine CANNOT use cached dst->neigh! | ||
123 | * Really, it is used only when dst->neigh is wrong. | ||
124 | */ | ||
125 | int eth_rebuild_header(struct sk_buff *skb) | ||
126 | { | ||
127 | struct ethhdr *eth = (struct ethhdr *)skb->data; | ||
128 | struct net_device *dev = skb->dev; | ||
129 | |||
130 | switch (eth->h_proto) { | ||
131 | #ifdef CONFIG_INET | ||
132 | case htons(ETH_P_IP): | ||
133 | return arp_find(eth->h_dest, skb); | ||
134 | #endif | ||
135 | default: | ||
136 | netdev_dbg(dev, | ||
137 | "%s: unable to resolve type %X addresses.\n", | ||
138 | dev->name, ntohs(eth->h_proto)); | ||
139 | |||
140 | memcpy(eth->h_source, dev->dev_addr, ETH_ALEN); | ||
141 | break; | ||
142 | } | ||
143 | |||
144 | return 0; | ||
145 | } | ||
146 | EXPORT_SYMBOL(eth_rebuild_header); | ||
147 | |||
148 | /** | ||
149 | * eth_get_headlen - determine the the length of header for an ethernet frame | 116 | * eth_get_headlen - determine the the length of header for an ethernet frame |
150 | * @data: pointer to start of frame | 117 | * @data: pointer to start of frame |
151 | * @len: total length of frame | 118 | * @len: total length of frame |
@@ -369,7 +336,6 @@ EXPORT_SYMBOL(eth_validate_addr); | |||
369 | const struct header_ops eth_header_ops ____cacheline_aligned = { | 336 | const struct header_ops eth_header_ops ____cacheline_aligned = { |
370 | .create = eth_header, | 337 | .create = eth_header, |
371 | .parse = eth_header_parse, | 338 | .parse = eth_header_parse, |
372 | .rebuild = eth_rebuild_header, | ||
373 | .cache = eth_header_cache, | 339 | .cache = eth_header_cache, |
374 | .cache_update = eth_header_cache_update, | 340 | .cache_update = eth_header_cache_update, |
375 | }; | 341 | }; |
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c index 6ae063cebf7d..988f542481a8 100644 --- a/net/netrom/nr_dev.c +++ b/net/netrom/nr_dev.c | |||
@@ -65,36 +65,6 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev) | |||
65 | return 1; | 65 | return 1; |
66 | } | 66 | } |
67 | 67 | ||
68 | #ifdef CONFIG_INET | ||
69 | |||
70 | static int nr_rebuild_header(struct sk_buff *skb) | ||
71 | { | ||
72 | unsigned char *bp = skb->data; | ||
73 | |||
74 | if (arp_find(bp + 7, skb)) | ||
75 | return 1; | ||
76 | |||
77 | bp[6] &= ~AX25_CBIT; | ||
78 | bp[6] &= ~AX25_EBIT; | ||
79 | bp[6] |= AX25_SSSID_SPARE; | ||
80 | bp += AX25_ADDR_LEN; | ||
81 | |||
82 | bp[6] &= ~AX25_CBIT; | ||
83 | bp[6] |= AX25_EBIT; | ||
84 | bp[6] |= AX25_SSSID_SPARE; | ||
85 | |||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | #else | ||
90 | |||
91 | static int nr_rebuild_header(struct sk_buff *skb) | ||
92 | { | ||
93 | return 1; | ||
94 | } | ||
95 | |||
96 | #endif | ||
97 | |||
98 | static int nr_header(struct sk_buff *skb, struct net_device *dev, | 68 | static int nr_header(struct sk_buff *skb, struct net_device *dev, |
99 | unsigned short type, | 69 | unsigned short type, |
100 | const void *daddr, const void *saddr, unsigned int len) | 70 | const void *daddr, const void *saddr, unsigned int len) |
@@ -188,7 +158,6 @@ static netdev_tx_t nr_xmit(struct sk_buff *skb, struct net_device *dev) | |||
188 | 158 | ||
189 | static const struct header_ops nr_header_ops = { | 159 | static const struct header_ops nr_header_ops = { |
190 | .create = nr_header, | 160 | .create = nr_header, |
191 | .rebuild= nr_rebuild_header, | ||
192 | }; | 161 | }; |
193 | 162 | ||
194 | static const struct net_device_ops nr_netdev_ops = { | 163 | static const struct net_device_ops nr_netdev_ops = { |
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index 90209c1fa49b..369ca81a8c5d 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c | |||
@@ -56,19 +56,6 @@ static int rose_header(struct sk_buff *skb, struct net_device *dev, | |||
56 | return -37; | 56 | return -37; |
57 | } | 57 | } |
58 | 58 | ||
59 | static int rose_rebuild_header(struct sk_buff *skb) | ||
60 | { | ||
61 | #ifdef CONFIG_INET | ||
62 | unsigned char *bp = (unsigned char *)skb->data; | ||
63 | |||
64 | if (arp_find(bp + 7, skb)) { | ||
65 | return 1; | ||
66 | } | ||
67 | |||
68 | #endif | ||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | static int rose_set_mac_address(struct net_device *dev, void *addr) | 59 | static int rose_set_mac_address(struct net_device *dev, void *addr) |
73 | { | 60 | { |
74 | struct sockaddr *sa = addr; | 61 | struct sockaddr *sa = addr; |
@@ -133,7 +120,6 @@ static netdev_tx_t rose_xmit(struct sk_buff *skb, struct net_device *dev) | |||
133 | 120 | ||
134 | static const struct header_ops rose_header_ops = { | 121 | static const struct header_ops rose_header_ops = { |
135 | .create = rose_header, | 122 | .create = rose_header, |
136 | .rebuild = rose_rebuild_header, | ||
137 | }; | 123 | }; |
138 | 124 | ||
139 | static const struct net_device_ops rose_netdev_ops = { | 125 | static const struct net_device_ops rose_netdev_ops = { |