Commit f2ccd8fa06c8e302116e71df372f5c1f83432e03

Authored by David S. Miller
Committed by David S. Miller
1 parent b6b99eb540

[NET]: Kill skb->real_dev

Bonding just wants the device before the skb_bond()
decapsulation occurs, so simply pass that original
device into packet_type->func() as an argument.

It remains to be seen whether we can use this same
exact thing to get rid of skb->input_dev as well.

Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 45 changed files with 96 additions and 91 deletions Side-by-side Diff

drivers/block/aoe/aoenet.c
... ... @@ -120,7 +120,7 @@
120 120 * (1) len doesn't include the header by default. I want this.
121 121 */
122 122 static int
123   -aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt)
  123 +aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, struct net_device *orig_dev)
124 124 {
125 125 struct aoe_hdr *h;
126 126 u32 n;
drivers/net/bonding/bond_3ad.c
... ... @@ -2419,22 +2419,19 @@
2419 2419 return 0;
2420 2420 }
2421 2421  
2422   -int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype)
  2422 +int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev)
2423 2423 {
2424 2424 struct bonding *bond = dev->priv;
2425 2425 struct slave *slave = NULL;
2426 2426 int ret = NET_RX_DROP;
2427 2427  
2428   - if (!(dev->flags & IFF_MASTER)) {
  2428 + if (!(dev->flags & IFF_MASTER))
2429 2429 goto out;
2430   - }
2431 2430  
2432 2431 read_lock(&bond->lock);
2433   - slave = bond_get_slave_by_dev((struct bonding *)dev->priv,
2434   - skb->real_dev);
2435   - if (slave == NULL) {
  2432 + slave = bond_get_slave_by_dev((struct bonding *)dev->priv, orig_dev);
  2433 + if (!slave)
2436 2434 goto out_unlock;
2437   - }
2438 2435  
2439 2436 bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
2440 2437  
drivers/net/bonding/bond_3ad.h
... ... @@ -295,6 +295,6 @@
295 295 void bond_3ad_handle_link_change(struct slave *slave, char link);
296 296 int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
297 297 int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
298   -int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype);
  298 +int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev);
299 299 #endif //__BOND_3AD_H__
drivers/net/bonding/bond_alb.c
... ... @@ -354,15 +354,14 @@
354 354 _unlock_rx_hashtbl(bond);
355 355 }
356 356  
357   -static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype)
  357 +static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype, struct net_device *orig_dev)
358 358 {
359 359 struct bonding *bond = bond_dev->priv;
360 360 struct arp_pkt *arp = (struct arp_pkt *)skb->data;
361 361 int res = NET_RX_DROP;
362 362  
363   - if (!(bond_dev->flags & IFF_MASTER)) {
  363 + if (!(bond_dev->flags & IFF_MASTER))
364 364 goto out;
365   - }
366 365  
367 366 if (!arp) {
368 367 dprintk("Packet has no ARP data\n");
drivers/net/hamradio/bpqether.c
... ... @@ -98,7 +98,7 @@
98 98  
99 99 static char bpq_eth_addr[6];
100 100  
101   -static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *);
  101 +static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
102 102 static int bpq_device_event(struct notifier_block *, unsigned long, void *);
103 103 static const char *bpq_print_ethaddr(const unsigned char *);
104 104  
... ... @@ -165,7 +165,7 @@
165 165 /*
166 166 * Receive an AX.25 frame via an ethernet interface.
167 167 */
168   -static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype)
  168 +static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype, struct net_device *orig_dev)
169 169 {
170 170 int len;
171 171 char * ptr;
... ... @@ -377,7 +377,8 @@
377 377 ***********************************************************************/
378 378 static int pppoe_rcv(struct sk_buff *skb,
379 379 struct net_device *dev,
380   - struct packet_type *pt)
  380 + struct packet_type *pt,
  381 + struct net_device *orig_dev)
381 382  
382 383 {
383 384 struct pppoe_hdr *ph;
... ... @@ -426,7 +427,8 @@
426 427 ***********************************************************************/
427 428 static int pppoe_disc_rcv(struct sk_buff *skb,
428 429 struct net_device *dev,
429   - struct packet_type *pt)
  430 + struct packet_type *pt,
  431 + struct net_device *orig_dev)
430 432  
431 433 {
432 434 struct pppoe_hdr *ph;
drivers/net/wan/hdlc_generic.c
... ... @@ -61,7 +61,7 @@
61 61  
62 62  
63 63 static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
64   - struct packet_type *p)
  64 + struct packet_type *p, struct net_device *orig_dev)
65 65 {
66 66 hdlc_device *hdlc = dev_to_hdlc(dev);
67 67 if (hdlc->proto.netif_rx)
drivers/net/wan/lapbether.c
... ... @@ -86,7 +86,7 @@
86 86 /*
87 87 * Receive a LAPB frame via an ethernet interface.
88 88 */
89   -static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype)
  89 +static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype, struct net_device *orig_dev)
90 90 {
91 91 int len, err;
92 92 struct lapbethdev *lapbeth;
drivers/net/wan/syncppp.c
... ... @@ -1447,7 +1447,7 @@
1447 1447 * after interrupt servicing to process frames queued via netif_rx.
1448 1448 */
1449 1449  
1450   -static int sppp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *p)
  1450 +static int sppp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *p, struct net_device *orig_dev)
1451 1451 {
1452 1452 if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
1453 1453 return NET_RX_DROP;
include/linux/if_vlan.h
... ... @@ -155,7 +155,6 @@
155 155 {
156 156 struct net_device_stats *stats;
157 157  
158   - skb->real_dev = skb->dev;
159 158 skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
160 159 if (skb->dev == NULL) {
161 160 dev_kfree_skb_any(skb);
include/linux/netdevice.h
... ... @@ -497,10 +497,12 @@
497 497 #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev))
498 498  
499 499 struct packet_type {
500   - __be16 type; /* This is really htons(ether_type). */
501   - struct net_device *dev; /* NULL is wildcarded here */
502   - int (*func) (struct sk_buff *, struct net_device *,
503   - struct packet_type *);
  500 + __be16 type; /* This is really htons(ether_type). */
  501 + struct net_device *dev; /* NULL is wildcarded here */
  502 + int (*func) (struct sk_buff *,
  503 + struct net_device *,
  504 + struct packet_type *,
  505 + struct net_device *);
504 506 void *af_packet_priv;
505 507 struct list_head list;
506 508 };
include/linux/skbuff.h
... ... @@ -164,7 +164,6 @@
164 164 * @stamp: Time we arrived
165 165 * @dev: Device we arrived on/are leaving by
166 166 * @input_dev: Device we arrived on
167   - * @real_dev: The real device we are using
168 167 * @h: Transport layer header
169 168 * @nh: Network layer header
170 169 * @mac: Link layer header
... ... @@ -206,7 +205,6 @@
206 205 struct timeval stamp;
207 206 struct net_device *dev;
208 207 struct net_device *input_dev;
209   - struct net_device *real_dev;
210 208  
211 209 union {
212 210 struct tcphdr *th;
... ... @@ -11,7 +11,7 @@
11 11  
12 12 extern void arp_init(void);
13 13 extern int arp_rcv(struct sk_buff *skb, struct net_device *dev,
14   - struct packet_type *pt);
  14 + struct packet_type *pt, struct net_device *orig_dev);
15 15 extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
16 16 extern int arp_ioctl(unsigned int cmd, void __user *arg);
17 17 extern void arp_send(int type, int ptype, u32 dest_ip,
... ... @@ -316,7 +316,7 @@
316 316  
317 317 /* ax25_in.c */
318 318 extern int ax25_rx_iframe(ax25_cb *, struct sk_buff *);
319   -extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *);
  319 +extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
320 320  
321 321 /* ax25_ip.c */
322 322 extern int ax25_encapsulate(struct sk_buff *, struct net_device *, unsigned short, void *, void *, unsigned int);
include/net/datalink.h
... ... @@ -9,7 +9,7 @@
9 9 unsigned short header_length;
10 10  
11 11 int (*rcvfunc)(struct sk_buff *, struct net_device *,
12   - struct packet_type *);
  12 + struct packet_type *, struct net_device *);
13 13 int (*request)(struct datalink_proto *, struct sk_buff *,
14 14 unsigned char *);
15 15 struct list_head node;
... ... @@ -86,7 +86,7 @@
86 86 u32 saddr, u32 daddr,
87 87 struct ip_options *opt);
88 88 extern int ip_rcv(struct sk_buff *skb, struct net_device *dev,
89   - struct packet_type *pt);
  89 + struct packet_type *pt, struct net_device *orig_dev);
90 90 extern int ip_local_deliver(struct sk_buff *skb);
91 91 extern int ip_mr_input(struct sk_buff *skb);
92 92 extern int ip_output(struct sk_buff *skb);
... ... @@ -346,7 +346,8 @@
346 346  
347 347 extern int ipv6_rcv(struct sk_buff *skb,
348 348 struct net_device *dev,
349   - struct packet_type *pt);
  349 + struct packet_type *pt,
  350 + struct net_device *orig_dev);
350 351  
351 352 /*
352 353 * upper-layer output functions
... ... @@ -46,7 +46,8 @@
46 46 unsigned char f_bit;
47 47 int (*rcv_func)(struct sk_buff *skb,
48 48 struct net_device *dev,
49   - struct packet_type *pt);
  49 + struct packet_type *pt,
  50 + struct net_device *orig_dev);
50 51 struct llc_addr laddr;
51 52 struct list_head node;
52 53 struct {
... ... @@ -64,7 +65,7 @@
64 65 extern unsigned char llc_station_mac_sa[ETH_ALEN];
65 66  
66 67 extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
67   - struct packet_type *pt);
  68 + struct packet_type *pt, struct net_device *orig_dev);
68 69  
69 70 extern int llc_mac_hdr_init(struct sk_buff *skb,
70 71 unsigned char *sa, unsigned char *da);
... ... @@ -78,7 +79,8 @@
78 79 extern struct llc_sap *llc_sap_open(unsigned char lsap,
79 80 int (*rcv)(struct sk_buff *skb,
80 81 struct net_device *dev,
81   - struct packet_type *pt));
  82 + struct packet_type *pt,
  83 + struct net_device *orig_dev));
82 84 extern void llc_sap_close(struct llc_sap *sap);
83 85  
84 86 extern struct llc_sap *llc_sap_find(unsigned char sap_value);
... ... @@ -4,7 +4,8 @@
4 4 register_8022_client(unsigned char type,
5 5 int (*func)(struct sk_buff *skb,
6 6 struct net_device *dev,
7   - struct packet_type *pt));
  7 + struct packet_type *pt,
  8 + struct net_device *orig_dev));
8 9 extern void unregister_8022_client(struct datalink_proto *proto);
9 10  
10 11 #endif
1 1 #ifndef _NET_PSNAP_H
2 2 #define _NET_PSNAP_H
3 3  
4   -extern struct datalink_proto *register_snap_client(unsigned char *desc, int (*rcvfunc)(struct sk_buff *, struct net_device *, struct packet_type *));
  4 +extern struct datalink_proto *register_snap_client(unsigned char *desc, int (*rcvfunc)(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *orig_dev));
5 5 extern void unregister_snap_client(struct datalink_proto *proto);
6 6  
7 7 #endif
... ... @@ -175,7 +175,7 @@
175 175  
176 176 /* x25_dev.c */
177 177 extern void x25_send_frame(struct sk_buff *, struct x25_neigh *);
178   -extern int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *);
  178 +extern int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
179 179 extern void x25_establish_link(struct x25_neigh *);
180 180 extern void x25_terminate_link(struct x25_neigh *);
181 181  
... ... @@ -35,7 +35,8 @@
35 35 struct datalink_proto *register_8022_client(unsigned char type,
36 36 int (*func)(struct sk_buff *skb,
37 37 struct net_device *dev,
38   - struct packet_type *pt))
  38 + struct packet_type *pt,
  39 + struct net_device *orig_dev))
39 40 {
40 41 struct datalink_proto *proto;
41 42  
... ... @@ -47,7 +47,7 @@
47 47 * A SNAP packet has arrived
48 48 */
49 49 static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
50   - struct packet_type *pt)
  50 + struct packet_type *pt, struct net_device *orig_dev)
51 51 {
52 52 int rc = 1;
53 53 struct datalink_proto *proto;
... ... @@ -61,7 +61,7 @@
61 61 /* Pass the frame on. */
62 62 skb->h.raw += 5;
63 63 skb_pull(skb, 5);
64   - rc = proto->rcvfunc(skb, dev, &snap_packet_type);
  64 + rc = proto->rcvfunc(skb, dev, &snap_packet_type, orig_dev);
65 65 } else {
66 66 skb->sk = NULL;
67 67 kfree_skb(skb);
... ... @@ -118,7 +118,8 @@
118 118 struct datalink_proto *register_snap_client(unsigned char *desc,
119 119 int (*rcvfunc)(struct sk_buff *,
120 120 struct net_device *,
121   - struct packet_type *))
  121 + struct packet_type *,
  122 + struct net_device *))
122 123 {
123 124 struct datalink_proto *proto = NULL;
124 125  
... ... @@ -51,7 +51,7 @@
51 51 /* found in vlan_dev.c */
52 52 int vlan_dev_rebuild_header(struct sk_buff *skb);
53 53 int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
54   - struct packet_type* ptype);
  54 + struct packet_type *ptype, struct net_device *orig_dev);
55 55 int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
56 56 unsigned short type, void *daddr, void *saddr,
57 57 unsigned len);
net/8021q/vlan_dev.c
... ... @@ -113,7 +113,7 @@
113 113 *
114 114 */
115 115 int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
116   - struct packet_type* ptype)
  116 + struct packet_type* ptype, struct net_device *orig_dev)
117 117 {
118 118 unsigned char *rawp = NULL;
119 119 struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
net/appletalk/aarp.c
... ... @@ -698,7 +698,7 @@
698 698 * frame. We currently only support Ethernet.
699 699 */
700 700 static int aarp_rcv(struct sk_buff *skb, struct net_device *dev,
701   - struct packet_type *pt)
  701 + struct packet_type *pt, struct net_device *orig_dev)
702 702 {
703 703 struct elapaarp *ea = aarp_hdr(skb);
704 704 int hash, ret = 0;
... ... @@ -1390,7 +1390,7 @@
1390 1390 * [ie ARPHRD_ETHERTALK]
1391 1391 */
1392 1392 static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
1393   - struct packet_type *pt)
  1393 + struct packet_type *pt, struct net_device *orig_dev)
1394 1394 {
1395 1395 struct ddpehdr *ddp;
1396 1396 struct sock *sock;
... ... @@ -1482,7 +1482,7 @@
1482 1482 * header and append a long one.
1483 1483 */
1484 1484 static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
1485   - struct packet_type *pt)
  1485 + struct packet_type *pt, struct net_device *orig_dev)
1486 1486 {
1487 1487 /* Expand any short form frames */
1488 1488 if (skb->mac.raw[2] == 1) {
... ... @@ -1528,7 +1528,7 @@
1528 1528 }
1529 1529 skb->h.raw = skb->data;
1530 1530  
1531   - return atalk_rcv(skb, dev, pt);
  1531 + return atalk_rcv(skb, dev, pt, orig_dev);
1532 1532 freeit:
1533 1533 kfree_skb(skb);
1534 1534 return 0;
... ... @@ -132,7 +132,7 @@
132 132 skb->dev = ax25->ax25_dev->dev;
133 133 skb->pkt_type = PACKET_HOST;
134 134 skb->protocol = htons(ETH_P_IP);
135   - ip_rcv(skb, skb->dev, NULL); /* Wrong ptype */
  135 + ip_rcv(skb, skb->dev, NULL, skb->dev); /* Wrong ptype */
136 136 return 1;
137 137 }
138 138 #endif
... ... @@ -258,7 +258,7 @@
258 258 skb->dev = dev;
259 259 skb->pkt_type = PACKET_HOST;
260 260 skb->protocol = htons(ETH_P_IP);
261   - ip_rcv(skb, dev, ptype); /* Note ptype here is the wrong one, fix me later */
  261 + ip_rcv(skb, dev, ptype, dev); /* Note ptype here is the wrong one, fix me later */
262 262 break;
263 263  
264 264 case AX25_P_ARP:
... ... @@ -268,7 +268,7 @@
268 268 skb->dev = dev;
269 269 skb->pkt_type = PACKET_HOST;
270 270 skb->protocol = htons(ETH_P_ARP);
271   - arp_rcv(skb, dev, ptype); /* Note ptype here is wrong... */
  271 + arp_rcv(skb, dev, ptype, dev); /* Note ptype here is wrong... */
272 272 break;
273 273 #endif
274 274 case AX25_P_TEXT:
... ... @@ -454,7 +454,7 @@
454 454 * Receive an AX.25 frame via a SLIP interface.
455 455 */
456 456 int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev,
457   - struct packet_type *ptype)
  457 + struct packet_type *ptype, struct net_device *orig_dev)
458 458 {
459 459 skb->sk = NULL; /* Initially we don't know who it's for */
460 460 skb->destructor = NULL; /* Who initializes this, dammit?! */
... ... @@ -1058,7 +1058,7 @@
1058 1058  
1059 1059 skb2->h.raw = skb2->nh.raw;
1060 1060 skb2->pkt_type = PACKET_OUTGOING;
1061   - ptype->func(skb2, skb->dev, ptype);
  1061 + ptype->func(skb2, skb->dev, ptype, skb->dev);
1062 1062 }
1063 1063 }
1064 1064 rcu_read_unlock();
1065 1065  
1066 1066  
... ... @@ -1425,14 +1425,14 @@
1425 1425  
1426 1426 EXPORT_SYMBOL(netif_rx_ni);
1427 1427  
1428   -static __inline__ void skb_bond(struct sk_buff *skb)
  1428 +static inline struct net_device *skb_bond(struct sk_buff *skb)
1429 1429 {
1430 1430 struct net_device *dev = skb->dev;
1431 1431  
1432   - if (dev->master) {
1433   - skb->real_dev = skb->dev;
  1432 + if (dev->master)
1434 1433 skb->dev = dev->master;
1435   - }
  1434 +
  1435 + return dev;
1436 1436 }
1437 1437  
1438 1438 static void net_tx_action(struct softirq_action *h)
1439 1439  
... ... @@ -1482,10 +1482,11 @@
1482 1482 }
1483 1483  
1484 1484 static __inline__ int deliver_skb(struct sk_buff *skb,
1485   - struct packet_type *pt_prev)
  1485 + struct packet_type *pt_prev,
  1486 + struct net_device *orig_dev)
1486 1487 {
1487 1488 atomic_inc(&skb->users);
1488   - return pt_prev->func(skb, skb->dev, pt_prev);
  1489 + return pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
1489 1490 }
1490 1491  
1491 1492 #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE)
... ... @@ -1496,7 +1497,8 @@
1496 1497 void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent);
1497 1498  
1498 1499 static __inline__ int handle_bridge(struct sk_buff **pskb,
1499   - struct packet_type **pt_prev, int *ret)
  1500 + struct packet_type **pt_prev, int *ret,
  1501 + struct net_device *orig_dev)
1500 1502 {
1501 1503 struct net_bridge_port *port;
1502 1504  
1503 1505  
... ... @@ -1505,14 +1507,14 @@
1505 1507 return 0;
1506 1508  
1507 1509 if (*pt_prev) {
1508   - *ret = deliver_skb(*pskb, *pt_prev);
  1510 + *ret = deliver_skb(*pskb, *pt_prev, orig_dev);
1509 1511 *pt_prev = NULL;
1510 1512 }
1511 1513  
1512 1514 return br_handle_frame_hook(port, pskb);
1513 1515 }
1514 1516 #else
1515   -#define handle_bridge(skb, pt_prev, ret) (0)
  1517 +#define handle_bridge(skb, pt_prev, ret, orig_dev) (0)
1516 1518 #endif
1517 1519  
1518 1520 #ifdef CONFIG_NET_CLS_ACT
... ... @@ -1559,6 +1561,7 @@
1559 1561 int netif_receive_skb(struct sk_buff *skb)
1560 1562 {
1561 1563 struct packet_type *ptype, *pt_prev;
  1564 + struct net_device *orig_dev;
1562 1565 int ret = NET_RX_DROP;
1563 1566 unsigned short type;
1564 1567  
... ... @@ -1569,7 +1572,7 @@
1569 1572 if (!skb->stamp.tv_sec)
1570 1573 net_timestamp(&skb->stamp);
1571 1574  
1572   - skb_bond(skb);
  1575 + orig_dev = skb_bond(skb);
1573 1576  
1574 1577 __get_cpu_var(netdev_rx_stat).total++;
1575 1578  
1576 1579  
... ... @@ -1590,14 +1593,14 @@
1590 1593 list_for_each_entry_rcu(ptype, &ptype_all, list) {
1591 1594 if (!ptype->dev || ptype->dev == skb->dev) {
1592 1595 if (pt_prev)
1593   - ret = deliver_skb(skb, pt_prev);
  1596 + ret = deliver_skb(skb, pt_prev, orig_dev);
1594 1597 pt_prev = ptype;
1595 1598 }
1596 1599 }
1597 1600  
1598 1601 #ifdef CONFIG_NET_CLS_ACT
1599 1602 if (pt_prev) {
1600   - ret = deliver_skb(skb, pt_prev);
  1603 + ret = deliver_skb(skb, pt_prev, orig_dev);
1601 1604 pt_prev = NULL; /* noone else should process this after*/
1602 1605 } else {
1603 1606 skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd);
... ... @@ -1616,7 +1619,7 @@
1616 1619  
1617 1620 handle_diverter(skb);
1618 1621  
1619   - if (handle_bridge(&skb, &pt_prev, &ret))
  1622 + if (handle_bridge(&skb, &pt_prev, &ret, orig_dev))
1620 1623 goto out;
1621 1624  
1622 1625 type = skb->protocol;
1623 1626  
... ... @@ -1624,13 +1627,13 @@
1624 1627 if (ptype->type == type &&
1625 1628 (!ptype->dev || ptype->dev == skb->dev)) {
1626 1629 if (pt_prev)
1627   - ret = deliver_skb(skb, pt_prev);
  1630 + ret = deliver_skb(skb, pt_prev, orig_dev);
1628 1631 pt_prev = ptype;
1629 1632 }
1630 1633 }
1631 1634  
1632 1635 if (pt_prev) {
1633   - ret = pt_prev->func(skb, skb->dev, pt_prev);
  1636 + ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
1634 1637 } else {
1635 1638 kfree_skb(skb);
1636 1639 /* Jamal, now you will not able to escape explaining
... ... @@ -333,7 +333,6 @@
333 333 n->sk = NULL;
334 334 C(stamp);
335 335 C(dev);
336   - C(real_dev);
337 336 C(h);
338 337 C(nh);
339 338 C(mac);
... ... @@ -397,7 +396,6 @@
397 396  
398 397 new->sk = NULL;
399 398 new->dev = old->dev;
400   - new->real_dev = old->real_dev;
401 399 new->priority = old->priority;
402 400 new->protocol = old->protocol;
403 401 new->dst = dst_clone(old->dst);
net/decnet/af_decnet.c
... ... @@ -2064,7 +2064,7 @@
2064 2064 .notifier_call = dn_device_event,
2065 2065 };
2066 2066  
2067   -extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *);
  2067 +extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
2068 2068  
2069 2069 static struct packet_type dn_dix_packet_type = {
2070 2070 .type = __constant_htons(ETH_P_DNA_RT),
net/decnet/dn_route.c
... ... @@ -572,7 +572,7 @@
572 572 return NET_RX_SUCCESS;
573 573 }
574 574  
575   -int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  575 +int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
576 576 {
577 577 struct dn_skb_cb *cb;
578 578 unsigned char flags = 0;
net/econet/af_econet.c
... ... @@ -1009,7 +1009,7 @@
1009 1009 * Receive an Econet frame from a device.
1010 1010 */
1011 1011  
1012   -static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  1012 +static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
1013 1013 {
1014 1014 struct ec_framehdr *hdr;
1015 1015 struct sock *sk;
... ... @@ -700,7 +700,7 @@
700 700 static void parp_redo(struct sk_buff *skb)
701 701 {
702 702 nf_reset(skb);
703   - arp_rcv(skb, skb->dev, NULL);
  703 + arp_rcv(skb, skb->dev, NULL, skb->dev);
704 704 }
705 705  
706 706 /*
... ... @@ -927,7 +927,7 @@
927 927 * Receive an arp request from the device layer.
928 928 */
929 929  
930   -int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  930 +int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
931 931 {
932 932 struct arphdr *arp;
933 933  
... ... @@ -358,7 +358,7 @@
358 358 /*
359 359 * Main IP Receive routine.
360 360 */
361   -int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  361 +int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
362 362 {
363 363 struct iphdr *iph;
364 364  
... ... @@ -393,7 +393,7 @@
393 393  
394 394 #ifdef IPCONFIG_RARP
395 395  
396   -static int ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt);
  396 +static int ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev);
397 397  
398 398 static struct packet_type rarp_packet_type __initdata = {
399 399 .type = __constant_htons(ETH_P_RARP),
... ... @@ -414,7 +414,7 @@
414 414 * Process received RARP packet.
415 415 */
416 416 static int __init
417   -ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  417 +ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
418 418 {
419 419 struct arphdr *rarp;
420 420 unsigned char *rarp_ptr;
... ... @@ -555,7 +555,7 @@
555 555 #define DHCPRELEASE 7
556 556 #define DHCPINFORM 8
557 557  
558   -static int ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt);
  558 +static int ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev);
559 559  
560 560 static struct packet_type bootp_packet_type __initdata = {
561 561 .type = __constant_htons(ETH_P_IP),
... ... @@ -823,7 +823,7 @@
823 823 /*
824 824 * Receive BOOTP reply.
825 825 */
826   -static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  826 +static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
827 827 {
828 828 struct bootp_pkt *b;
829 829 struct iphdr *h;
net/ipv6/ip6_input.c
... ... @@ -56,7 +56,7 @@
56 56 return dst_input(skb);
57 57 }
58 58  
59   -int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  59 +int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
60 60 {
61 61 struct ipv6hdr *hdr;
62 62 u32 pkt_len;
... ... @@ -1627,7 +1627,7 @@
1627 1627 return rc;
1628 1628 }
1629 1629  
1630   -static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  1630 +static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
1631 1631 {
1632 1632 /* NULL here for pt means the packet was looped back */
1633 1633 struct ipx_interface *intrfc;
net/irda/irlap_frame.c
... ... @@ -1303,7 +1303,7 @@
1303 1303 * Jean II
1304 1304 */
1305 1305 int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
1306   - struct packet_type *ptype)
  1306 + struct packet_type *ptype, struct net_device *orig_dev)
1307 1307 {
1308 1308 struct irlap_info info;
1309 1309 struct irlap_cb *self;
... ... @@ -54,7 +54,7 @@
54 54 extern void irsock_cleanup(void);
55 55 /* irlap_frame.c */
56 56 extern int irlap_driver_rcv(struct sk_buff *, struct net_device *,
57   - struct packet_type *);
  57 + struct packet_type *, struct net_device *);
58 58  
59 59 /*
60 60 * Module parameters
... ... @@ -103,7 +103,8 @@
103 103 struct llc_sap *llc_sap_open(unsigned char lsap,
104 104 int (*func)(struct sk_buff *skb,
105 105 struct net_device *dev,
106   - struct packet_type *pt))
  106 + struct packet_type *pt,
  107 + struct net_device *orig_dev))
107 108 {
108 109 struct llc_sap *sap = llc_sap_find(lsap);
109 110  
... ... @@ -132,7 +132,7 @@
132 132 * data now), it queues this frame in the connection's backlog.
133 133 */
134 134 int llc_rcv(struct sk_buff *skb, struct net_device *dev,
135   - struct packet_type *pt)
  135 + struct packet_type *pt, struct net_device *orig_dev)
136 136 {
137 137 struct llc_sap *sap;
138 138 struct llc_pdu_sn *pdu;
... ... @@ -165,7 +165,7 @@
165 165 * LLC functionality
166 166 */
167 167 if (sap->rcv_func) {
168   - sap->rcv_func(skb, dev, pt);
  168 + sap->rcv_func(skb, dev, pt, orig_dev);
169 169 goto out;
170 170 }
171 171 dest = llc_pdu_type(skb);
... ... @@ -64,7 +64,7 @@
64 64 skb->nh.raw = skb->data;
65 65 skb->pkt_type = PACKET_HOST;
66 66  
67   - ip_rcv(skb, skb->dev, NULL);
  67 + ip_rcv(skb, skb->dev, NULL, skb->dev);
68 68  
69 69 return 1;
70 70 }
net/packet/af_packet.c
... ... @@ -241,7 +241,7 @@
241 241 #ifdef CONFIG_SOCK_PACKET
242 242 static struct proto_ops packet_ops_spkt;
243 243  
244   -static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  244 +static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
245 245 {
246 246 struct sock *sk;
247 247 struct sockaddr_pkt *spkt;
... ... @@ -441,7 +441,7 @@
441 441 we will not harm anyone.
442 442 */
443 443  
444   -static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  444 +static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
445 445 {
446 446 struct sock *sk;
447 447 struct sockaddr_ll *sll;
... ... @@ -546,7 +546,7 @@
546 546 }
547 547  
548 548 #ifdef CONFIG_PACKET_MMAP
549   -static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
  549 +static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
550 550 {
551 551 struct sock *sk;
552 552 struct packet_sock *po;
... ... @@ -81,7 +81,7 @@
81 81 }
82 82  
83 83 int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
84   - struct packet_type *ptype)
  84 + struct packet_type *ptype, struct net_device *orig_dev)
85 85 {
86 86 struct sk_buff *nskb;
87 87 struct x25_neigh *nb;