[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>
This commit is contained in:
David S. Miller 2005-08-09 19:34:12 -07:00 committed by David S. Miller
parent b6b99eb540
commit f2ccd8fa06
45 changed files with 96 additions and 91 deletions

View file

@ -120,7 +120,7 @@ aoenet_xmit(struct sk_buff *sl)
* (1) len doesn't include the header by default. I want this. * (1) len doesn't include the header by default. I want this.
*/ */
static int static int
aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt) aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct aoe_hdr *h; struct aoe_hdr *h;
u32 n; u32 n;

View file

@ -2419,22 +2419,19 @@ out:
return 0; return 0;
} }
int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype) int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev)
{ {
struct bonding *bond = dev->priv; struct bonding *bond = dev->priv;
struct slave *slave = NULL; struct slave *slave = NULL;
int ret = NET_RX_DROP; int ret = NET_RX_DROP;
if (!(dev->flags & IFF_MASTER)) { if (!(dev->flags & IFF_MASTER))
goto out; goto out;
}
read_lock(&bond->lock); read_lock(&bond->lock);
slave = bond_get_slave_by_dev((struct bonding *)dev->priv, slave = bond_get_slave_by_dev((struct bonding *)dev->priv, orig_dev);
skb->real_dev); if (!slave)
if (slave == NULL) {
goto out_unlock; goto out_unlock;
}
bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);

View file

@ -295,6 +295,6 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave);
void bond_3ad_handle_link_change(struct slave *slave, char link); void bond_3ad_handle_link_change(struct slave *slave, char link);
int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype); int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type* ptype, struct net_device *orig_dev);
#endif //__BOND_3AD_H__ #endif //__BOND_3AD_H__

View file

@ -354,15 +354,14 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
_unlock_rx_hashtbl(bond); _unlock_rx_hashtbl(bond);
} }
static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype) static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype, struct net_device *orig_dev)
{ {
struct bonding *bond = bond_dev->priv; struct bonding *bond = bond_dev->priv;
struct arp_pkt *arp = (struct arp_pkt *)skb->data; struct arp_pkt *arp = (struct arp_pkt *)skb->data;
int res = NET_RX_DROP; int res = NET_RX_DROP;
if (!(bond_dev->flags & IFF_MASTER)) { if (!(bond_dev->flags & IFF_MASTER))
goto out; goto out;
}
if (!arp) { if (!arp) {
dprintk("Packet has no ARP data\n"); dprintk("Packet has no ARP data\n");

View file

@ -98,7 +98,7 @@ static char bcast_addr[6]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
static char bpq_eth_addr[6]; static char bpq_eth_addr[6];
static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *); static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
static int bpq_device_event(struct notifier_block *, unsigned long, void *); static int bpq_device_event(struct notifier_block *, unsigned long, void *);
static const char *bpq_print_ethaddr(const unsigned char *); static const char *bpq_print_ethaddr(const unsigned char *);
@ -165,7 +165,7 @@ static inline int dev_is_ethdev(struct net_device *dev)
/* /*
* Receive an AX.25 frame via an ethernet interface. * Receive an AX.25 frame via an ethernet interface.
*/ */
static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype) static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype, struct net_device *orig_dev)
{ {
int len; int len;
char * ptr; char * ptr;

View file

@ -377,7 +377,8 @@ abort_kfree:
***********************************************************************/ ***********************************************************************/
static int pppoe_rcv(struct sk_buff *skb, static int pppoe_rcv(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt) struct packet_type *pt,
struct net_device *orig_dev)
{ {
struct pppoe_hdr *ph; struct pppoe_hdr *ph;
@ -426,7 +427,8 @@ out:
***********************************************************************/ ***********************************************************************/
static int pppoe_disc_rcv(struct sk_buff *skb, static int pppoe_disc_rcv(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt) struct packet_type *pt,
struct net_device *orig_dev)
{ {
struct pppoe_hdr *ph; struct pppoe_hdr *ph;

View file

@ -61,7 +61,7 @@ static struct net_device_stats *hdlc_get_stats(struct net_device *dev)
static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev, static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *p) struct packet_type *p, struct net_device *orig_dev)
{ {
hdlc_device *hdlc = dev_to_hdlc(dev); hdlc_device *hdlc = dev_to_hdlc(dev);
if (hdlc->proto.netif_rx) if (hdlc->proto.netif_rx)

View file

@ -86,7 +86,7 @@ static __inline__ int dev_is_ethdev(struct net_device *dev)
/* /*
* Receive a LAPB frame via an ethernet interface. * Receive a LAPB frame via an ethernet interface.
*/ */
static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype) static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype, struct net_device *orig_dev)
{ {
int len, err; int len, err;
struct lapbethdev *lapbeth; struct lapbethdev *lapbeth;

View file

@ -1447,7 +1447,7 @@ static void sppp_print_bytes (u_char *p, u16 len)
* after interrupt servicing to process frames queued via netif_rx. * after interrupt servicing to process frames queued via netif_rx.
*/ */
static int sppp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *p) static int sppp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *p, struct net_device *orig_dev)
{ {
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
return NET_RX_DROP; return NET_RX_DROP;

View file

@ -155,7 +155,6 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
{ {
struct net_device_stats *stats; struct net_device_stats *stats;
skb->real_dev = skb->dev;
skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK]; skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
if (skb->dev == NULL) { if (skb->dev == NULL) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);

View file

@ -497,10 +497,12 @@ static inline void *netdev_priv(struct net_device *dev)
#define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev))
struct packet_type { struct packet_type {
__be16 type; /* This is really htons(ether_type). */ __be16 type; /* This is really htons(ether_type). */
struct net_device *dev; /* NULL is wildcarded here */ struct net_device *dev; /* NULL is wildcarded here */
int (*func) (struct sk_buff *, struct net_device *, int (*func) (struct sk_buff *,
struct packet_type *); struct net_device *,
struct packet_type *,
struct net_device *);
void *af_packet_priv; void *af_packet_priv;
struct list_head list; struct list_head list;
}; };

View file

@ -164,7 +164,6 @@ struct skb_shared_info {
* @stamp: Time we arrived * @stamp: Time we arrived
* @dev: Device we arrived on/are leaving by * @dev: Device we arrived on/are leaving by
* @input_dev: Device we arrived on * @input_dev: Device we arrived on
* @real_dev: The real device we are using
* @h: Transport layer header * @h: Transport layer header
* @nh: Network layer header * @nh: Network layer header
* @mac: Link layer header * @mac: Link layer header
@ -206,7 +205,6 @@ struct sk_buff {
struct timeval stamp; struct timeval stamp;
struct net_device *dev; struct net_device *dev;
struct net_device *input_dev; struct net_device *input_dev;
struct net_device *real_dev;
union { union {
struct tcphdr *th; struct tcphdr *th;

View file

@ -11,7 +11,7 @@ extern struct neigh_table arp_tbl;
extern void arp_init(void); extern void arp_init(void);
extern int arp_rcv(struct sk_buff *skb, struct net_device *dev, extern int arp_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt); struct packet_type *pt, struct net_device *orig_dev);
extern int arp_find(unsigned char *haddr, struct sk_buff *skb); extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
extern int arp_ioctl(unsigned int cmd, void __user *arg); extern int arp_ioctl(unsigned int cmd, void __user *arg);
extern void arp_send(int type, int ptype, u32 dest_ip, extern void arp_send(int type, int ptype, u32 dest_ip,

View file

@ -316,7 +316,7 @@ extern int ax25_protocol_is_registered(unsigned int);
/* ax25_in.c */ /* ax25_in.c */
extern int ax25_rx_iframe(ax25_cb *, struct sk_buff *); extern int ax25_rx_iframe(ax25_cb *, struct sk_buff *);
extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *); extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
/* ax25_ip.c */ /* ax25_ip.c */
extern int ax25_encapsulate(struct sk_buff *, struct net_device *, unsigned short, void *, void *, unsigned int); extern int ax25_encapsulate(struct sk_buff *, struct net_device *, unsigned short, void *, void *, unsigned int);

View file

@ -9,7 +9,7 @@ struct datalink_proto {
unsigned short header_length; unsigned short header_length;
int (*rcvfunc)(struct sk_buff *, struct net_device *, int (*rcvfunc)(struct sk_buff *, struct net_device *,
struct packet_type *); struct packet_type *, struct net_device *);
int (*request)(struct datalink_proto *, struct sk_buff *, int (*request)(struct datalink_proto *, struct sk_buff *,
unsigned char *); unsigned char *);
struct list_head node; struct list_head node;

View file

@ -86,7 +86,7 @@ extern int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
u32 saddr, u32 daddr, u32 saddr, u32 daddr,
struct ip_options *opt); struct ip_options *opt);
extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, extern int ip_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt); struct packet_type *pt, struct net_device *orig_dev);
extern int ip_local_deliver(struct sk_buff *skb); extern int ip_local_deliver(struct sk_buff *skb);
extern int ip_mr_input(struct sk_buff *skb); extern int ip_mr_input(struct sk_buff *skb);
extern int ip_output(struct sk_buff *skb); extern int ip_output(struct sk_buff *skb);

View file

@ -346,7 +346,8 @@ static inline int ipv6_addr_any(const struct in6_addr *a)
extern int ipv6_rcv(struct sk_buff *skb, extern int ipv6_rcv(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt); struct packet_type *pt,
struct net_device *orig_dev);
/* /*
* upper-layer output functions * upper-layer output functions

View file

@ -46,7 +46,8 @@ struct llc_sap {
unsigned char f_bit; unsigned char f_bit;
int (*rcv_func)(struct sk_buff *skb, int (*rcv_func)(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt); struct packet_type *pt,
struct net_device *orig_dev);
struct llc_addr laddr; struct llc_addr laddr;
struct list_head node; struct list_head node;
struct { struct {
@ -64,7 +65,7 @@ extern rwlock_t llc_sap_list_lock;
extern unsigned char llc_station_mac_sa[ETH_ALEN]; extern unsigned char llc_station_mac_sa[ETH_ALEN];
extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt); struct packet_type *pt, struct net_device *orig_dev);
extern int llc_mac_hdr_init(struct sk_buff *skb, extern int llc_mac_hdr_init(struct sk_buff *skb,
unsigned char *sa, unsigned char *da); unsigned char *sa, unsigned char *da);
@ -78,7 +79,8 @@ extern void llc_set_station_handler(void (*handler)(struct sk_buff *skb));
extern struct llc_sap *llc_sap_open(unsigned char lsap, extern struct llc_sap *llc_sap_open(unsigned char lsap,
int (*rcv)(struct sk_buff *skb, int (*rcv)(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt)); struct packet_type *pt,
struct net_device *orig_dev));
extern void llc_sap_close(struct llc_sap *sap); extern void llc_sap_close(struct llc_sap *sap);
extern struct llc_sap *llc_sap_find(unsigned char sap_value); extern struct llc_sap *llc_sap_find(unsigned char sap_value);

View file

@ -4,7 +4,8 @@ extern struct datalink_proto *
register_8022_client(unsigned char type, register_8022_client(unsigned char type,
int (*func)(struct sk_buff *skb, int (*func)(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt)); struct packet_type *pt,
struct net_device *orig_dev));
extern void unregister_8022_client(struct datalink_proto *proto); extern void unregister_8022_client(struct datalink_proto *proto);
#endif #endif

View file

@ -1,7 +1,7 @@
#ifndef _NET_PSNAP_H #ifndef _NET_PSNAP_H
#define _NET_PSNAP_H #define _NET_PSNAP_H
extern struct datalink_proto *register_snap_client(unsigned char *desc, int (*rcvfunc)(struct sk_buff *, struct net_device *, struct packet_type *)); 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));
extern void unregister_snap_client(struct datalink_proto *proto); extern void unregister_snap_client(struct datalink_proto *proto);
#endif #endif

View file

@ -175,7 +175,7 @@ extern void x25_kill_by_neigh(struct x25_neigh *);
/* x25_dev.c */ /* x25_dev.c */
extern void x25_send_frame(struct sk_buff *, struct x25_neigh *); extern void x25_send_frame(struct sk_buff *, struct x25_neigh *);
extern int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *); extern int x25_lapb_receive_frame(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
extern void x25_establish_link(struct x25_neigh *); extern void x25_establish_link(struct x25_neigh *);
extern void x25_terminate_link(struct x25_neigh *); extern void x25_terminate_link(struct x25_neigh *);

View file

@ -35,7 +35,8 @@ static int p8022_request(struct datalink_proto *dl, struct sk_buff *skb,
struct datalink_proto *register_8022_client(unsigned char type, struct datalink_proto *register_8022_client(unsigned char type,
int (*func)(struct sk_buff *skb, int (*func)(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt)) struct packet_type *pt,
struct net_device *orig_dev))
{ {
struct datalink_proto *proto; struct datalink_proto *proto;

View file

@ -47,7 +47,7 @@ static struct datalink_proto *find_snap_client(unsigned char *desc)
* A SNAP packet has arrived * A SNAP packet has arrived
*/ */
static int snap_rcv(struct sk_buff *skb, struct net_device *dev, static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt) struct packet_type *pt, struct net_device *orig_dev)
{ {
int rc = 1; int rc = 1;
struct datalink_proto *proto; struct datalink_proto *proto;
@ -61,7 +61,7 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
/* Pass the frame on. */ /* Pass the frame on. */
skb->h.raw += 5; skb->h.raw += 5;
skb_pull(skb, 5); skb_pull(skb, 5);
rc = proto->rcvfunc(skb, dev, &snap_packet_type); rc = proto->rcvfunc(skb, dev, &snap_packet_type, orig_dev);
} else { } else {
skb->sk = NULL; skb->sk = NULL;
kfree_skb(skb); kfree_skb(skb);
@ -118,7 +118,8 @@ module_exit(snap_exit);
struct datalink_proto *register_snap_client(unsigned char *desc, struct datalink_proto *register_snap_client(unsigned char *desc,
int (*rcvfunc)(struct sk_buff *, int (*rcvfunc)(struct sk_buff *,
struct net_device *, struct net_device *,
struct packet_type *)) struct packet_type *,
struct net_device *))
{ {
struct datalink_proto *proto = NULL; struct datalink_proto *proto = NULL;

View file

@ -51,7 +51,7 @@ struct net_device *__find_vlan_dev(struct net_device* real_dev,
/* found in vlan_dev.c */ /* found in vlan_dev.c */
int vlan_dev_rebuild_header(struct sk_buff *skb); int vlan_dev_rebuild_header(struct sk_buff *skb);
int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev, int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type* ptype); struct packet_type *ptype, struct net_device *orig_dev);
int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev, int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, void *daddr, void *saddr, unsigned short type, void *daddr, void *saddr,
unsigned len); unsigned len);

View file

@ -113,7 +113,7 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
* *
*/ */
int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev, int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type* ptype) struct packet_type* ptype, struct net_device *orig_dev)
{ {
unsigned char *rawp = NULL; unsigned char *rawp = NULL;
struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data); struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);

View file

@ -698,7 +698,7 @@ static void __aarp_resolved(struct aarp_entry **list, struct aarp_entry *a,
* frame. We currently only support Ethernet. * frame. We currently only support Ethernet.
*/ */
static int aarp_rcv(struct sk_buff *skb, struct net_device *dev, static int aarp_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt) struct packet_type *pt, struct net_device *orig_dev)
{ {
struct elapaarp *ea = aarp_hdr(skb); struct elapaarp *ea = aarp_hdr(skb);
int hash, ret = 0; int hash, ret = 0;

View file

@ -1390,7 +1390,7 @@ free_it:
* [ie ARPHRD_ETHERTALK] * [ie ARPHRD_ETHERTALK]
*/ */
static int atalk_rcv(struct sk_buff *skb, struct net_device *dev, static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt) struct packet_type *pt, struct net_device *orig_dev)
{ {
struct ddpehdr *ddp; struct ddpehdr *ddp;
struct sock *sock; struct sock *sock;
@ -1482,7 +1482,7 @@ freeit:
* header and append a long one. * header and append a long one.
*/ */
static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev, static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt) struct packet_type *pt, struct net_device *orig_dev)
{ {
/* Expand any short form frames */ /* Expand any short form frames */
if (skb->mac.raw[2] == 1) { if (skb->mac.raw[2] == 1) {
@ -1528,7 +1528,7 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
} }
skb->h.raw = skb->data; skb->h.raw = skb->data;
return atalk_rcv(skb, dev, pt); return atalk_rcv(skb, dev, pt, orig_dev);
freeit: freeit:
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;

View file

@ -132,7 +132,7 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
skb->dev = ax25->ax25_dev->dev; skb->dev = ax25->ax25_dev->dev;
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
skb->protocol = htons(ETH_P_IP); skb->protocol = htons(ETH_P_IP);
ip_rcv(skb, skb->dev, NULL); /* Wrong ptype */ ip_rcv(skb, skb->dev, NULL, skb->dev); /* Wrong ptype */
return 1; return 1;
} }
#endif #endif
@ -258,7 +258,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
skb->dev = dev; skb->dev = dev;
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
skb->protocol = htons(ETH_P_IP); skb->protocol = htons(ETH_P_IP);
ip_rcv(skb, dev, ptype); /* Note ptype here is the wrong one, fix me later */ ip_rcv(skb, dev, ptype, dev); /* Note ptype here is the wrong one, fix me later */
break; break;
case AX25_P_ARP: case AX25_P_ARP:
@ -268,7 +268,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
skb->dev = dev; skb->dev = dev;
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
skb->protocol = htons(ETH_P_ARP); skb->protocol = htons(ETH_P_ARP);
arp_rcv(skb, dev, ptype); /* Note ptype here is wrong... */ arp_rcv(skb, dev, ptype, dev); /* Note ptype here is wrong... */
break; break;
#endif #endif
case AX25_P_TEXT: case AX25_P_TEXT:
@ -454,7 +454,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
* Receive an AX.25 frame via a SLIP interface. * Receive an AX.25 frame via a SLIP interface.
*/ */
int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev, int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype) struct packet_type *ptype, struct net_device *orig_dev)
{ {
skb->sk = NULL; /* Initially we don't know who it's for */ skb->sk = NULL; /* Initially we don't know who it's for */
skb->destructor = NULL; /* Who initializes this, dammit?! */ skb->destructor = NULL; /* Who initializes this, dammit?! */

View file

@ -1058,7 +1058,7 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
skb2->h.raw = skb2->nh.raw; skb2->h.raw = skb2->nh.raw;
skb2->pkt_type = PACKET_OUTGOING; skb2->pkt_type = PACKET_OUTGOING;
ptype->func(skb2, skb->dev, ptype); ptype->func(skb2, skb->dev, ptype, skb->dev);
} }
} }
rcu_read_unlock(); rcu_read_unlock();
@ -1425,14 +1425,14 @@ int netif_rx_ni(struct sk_buff *skb)
EXPORT_SYMBOL(netif_rx_ni); EXPORT_SYMBOL(netif_rx_ni);
static __inline__ void skb_bond(struct sk_buff *skb) static inline struct net_device *skb_bond(struct sk_buff *skb)
{ {
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
if (dev->master) { if (dev->master)
skb->real_dev = skb->dev;
skb->dev = dev->master; skb->dev = dev->master;
}
return dev;
} }
static void net_tx_action(struct softirq_action *h) static void net_tx_action(struct softirq_action *h)
@ -1482,10 +1482,11 @@ static void net_tx_action(struct softirq_action *h)
} }
static __inline__ int deliver_skb(struct sk_buff *skb, static __inline__ int deliver_skb(struct sk_buff *skb,
struct packet_type *pt_prev) struct packet_type *pt_prev,
struct net_device *orig_dev)
{ {
atomic_inc(&skb->users); atomic_inc(&skb->users);
return pt_prev->func(skb, skb->dev, pt_prev); return pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
} }
#if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE) #if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE)
@ -1496,7 +1497,8 @@ struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br,
void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent); void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent);
static __inline__ int handle_bridge(struct sk_buff **pskb, static __inline__ int handle_bridge(struct sk_buff **pskb,
struct packet_type **pt_prev, int *ret) struct packet_type **pt_prev, int *ret,
struct net_device *orig_dev)
{ {
struct net_bridge_port *port; struct net_bridge_port *port;
@ -1505,14 +1507,14 @@ static __inline__ int handle_bridge(struct sk_buff **pskb,
return 0; return 0;
if (*pt_prev) { if (*pt_prev) {
*ret = deliver_skb(*pskb, *pt_prev); *ret = deliver_skb(*pskb, *pt_prev, orig_dev);
*pt_prev = NULL; *pt_prev = NULL;
} }
return br_handle_frame_hook(port, pskb); return br_handle_frame_hook(port, pskb);
} }
#else #else
#define handle_bridge(skb, pt_prev, ret) (0) #define handle_bridge(skb, pt_prev, ret, orig_dev) (0)
#endif #endif
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
@ -1559,6 +1561,7 @@ static int ing_filter(struct sk_buff *skb)
int netif_receive_skb(struct sk_buff *skb) int netif_receive_skb(struct sk_buff *skb)
{ {
struct packet_type *ptype, *pt_prev; struct packet_type *ptype, *pt_prev;
struct net_device *orig_dev;
int ret = NET_RX_DROP; int ret = NET_RX_DROP;
unsigned short type; unsigned short type;
@ -1569,7 +1572,7 @@ int netif_receive_skb(struct sk_buff *skb)
if (!skb->stamp.tv_sec) if (!skb->stamp.tv_sec)
net_timestamp(&skb->stamp); net_timestamp(&skb->stamp);
skb_bond(skb); orig_dev = skb_bond(skb);
__get_cpu_var(netdev_rx_stat).total++; __get_cpu_var(netdev_rx_stat).total++;
@ -1590,14 +1593,14 @@ int netif_receive_skb(struct sk_buff *skb)
list_for_each_entry_rcu(ptype, &ptype_all, list) { list_for_each_entry_rcu(ptype, &ptype_all, list) {
if (!ptype->dev || ptype->dev == skb->dev) { if (!ptype->dev || ptype->dev == skb->dev) {
if (pt_prev) if (pt_prev)
ret = deliver_skb(skb, pt_prev); ret = deliver_skb(skb, pt_prev, orig_dev);
pt_prev = ptype; pt_prev = ptype;
} }
} }
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
if (pt_prev) { if (pt_prev) {
ret = deliver_skb(skb, pt_prev); ret = deliver_skb(skb, pt_prev, orig_dev);
pt_prev = NULL; /* noone else should process this after*/ pt_prev = NULL; /* noone else should process this after*/
} else { } else {
skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd); skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd);
@ -1616,7 +1619,7 @@ ncls:
handle_diverter(skb); handle_diverter(skb);
if (handle_bridge(&skb, &pt_prev, &ret)) if (handle_bridge(&skb, &pt_prev, &ret, orig_dev))
goto out; goto out;
type = skb->protocol; type = skb->protocol;
@ -1624,13 +1627,13 @@ ncls:
if (ptype->type == type && if (ptype->type == type &&
(!ptype->dev || ptype->dev == skb->dev)) { (!ptype->dev || ptype->dev == skb->dev)) {
if (pt_prev) if (pt_prev)
ret = deliver_skb(skb, pt_prev); ret = deliver_skb(skb, pt_prev, orig_dev);
pt_prev = ptype; pt_prev = ptype;
} }
} }
if (pt_prev) { if (pt_prev) {
ret = pt_prev->func(skb, skb->dev, pt_prev); ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
} else { } else {
kfree_skb(skb); kfree_skb(skb);
/* Jamal, now you will not able to escape explaining /* Jamal, now you will not able to escape explaining

View file

@ -333,7 +333,6 @@ struct sk_buff *skb_clone(struct sk_buff *skb, unsigned int __nocast gfp_mask)
n->sk = NULL; n->sk = NULL;
C(stamp); C(stamp);
C(dev); C(dev);
C(real_dev);
C(h); C(h);
C(nh); C(nh);
C(mac); C(mac);
@ -397,7 +396,6 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
new->sk = NULL; new->sk = NULL;
new->dev = old->dev; new->dev = old->dev;
new->real_dev = old->real_dev;
new->priority = old->priority; new->priority = old->priority;
new->protocol = old->protocol; new->protocol = old->protocol;
new->dst = dst_clone(old->dst); new->dst = dst_clone(old->dst);

View file

@ -2064,7 +2064,7 @@ static struct notifier_block dn_dev_notifier = {
.notifier_call = dn_device_event, .notifier_call = dn_device_event,
}; };
extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *); extern int dn_route_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
static struct packet_type dn_dix_packet_type = { static struct packet_type dn_dix_packet_type = {
.type = __constant_htons(ETH_P_DNA_RT), .type = __constant_htons(ETH_P_DNA_RT),

View file

@ -572,7 +572,7 @@ static int dn_route_ptp_hello(struct sk_buff *skb)
return NET_RX_SUCCESS; return NET_RX_SUCCESS;
} }
int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct dn_skb_cb *cb; struct dn_skb_cb *cb;
unsigned char flags = 0; unsigned char flags = 0;

View file

@ -1009,7 +1009,7 @@ release:
* Receive an Econet frame from a device. * Receive an Econet frame from a device.
*/ */
static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) static int econet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct ec_framehdr *hdr; struct ec_framehdr *hdr;
struct sock *sk; struct sock *sk;

View file

@ -700,7 +700,7 @@ void arp_send(int type, int ptype, u32 dest_ip,
static void parp_redo(struct sk_buff *skb) static void parp_redo(struct sk_buff *skb)
{ {
nf_reset(skb); nf_reset(skb);
arp_rcv(skb, skb->dev, NULL); arp_rcv(skb, skb->dev, NULL, skb->dev);
} }
/* /*
@ -927,7 +927,7 @@ out:
* Receive an arp request from the device layer. * Receive an arp request from the device layer.
*/ */
int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct arphdr *arp; struct arphdr *arp;

View file

@ -358,7 +358,7 @@ drop:
/* /*
* Main IP Receive routine. * Main IP Receive routine.
*/ */
int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct iphdr *iph; struct iphdr *iph;

View file

@ -393,7 +393,7 @@ static int __init ic_defaults(void)
#ifdef IPCONFIG_RARP #ifdef IPCONFIG_RARP
static int ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt); static int ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev);
static struct packet_type rarp_packet_type __initdata = { static struct packet_type rarp_packet_type __initdata = {
.type = __constant_htons(ETH_P_RARP), .type = __constant_htons(ETH_P_RARP),
@ -414,7 +414,7 @@ static inline void ic_rarp_cleanup(void)
* Process received RARP packet. * Process received RARP packet.
*/ */
static int __init static int __init
ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct arphdr *rarp; struct arphdr *rarp;
unsigned char *rarp_ptr; unsigned char *rarp_ptr;
@ -555,7 +555,7 @@ struct bootp_pkt { /* BOOTP packet format */
#define DHCPRELEASE 7 #define DHCPRELEASE 7
#define DHCPINFORM 8 #define DHCPINFORM 8
static int ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt); static int ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev);
static struct packet_type bootp_packet_type __initdata = { static struct packet_type bootp_packet_type __initdata = {
.type = __constant_htons(ETH_P_IP), .type = __constant_htons(ETH_P_IP),
@ -823,7 +823,7 @@ static void __init ic_do_bootp_ext(u8 *ext)
/* /*
* Receive BOOTP reply. * Receive BOOTP reply.
*/ */
static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct bootp_pkt *b; struct bootp_pkt *b;
struct iphdr *h; struct iphdr *h;

View file

@ -56,7 +56,7 @@ static inline int ip6_rcv_finish( struct sk_buff *skb)
return dst_input(skb); return dst_input(skb);
} }
int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct ipv6hdr *hdr; struct ipv6hdr *hdr;
u32 pkt_len; u32 pkt_len;

View file

@ -1627,7 +1627,7 @@ out:
return rc; return rc;
} }
static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
/* NULL here for pt means the packet was looped back */ /* NULL here for pt means the packet was looped back */
struct ipx_interface *intrfc; struct ipx_interface *intrfc;

View file

@ -1303,7 +1303,7 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb,
* Jean II * Jean II
*/ */
int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype) struct packet_type *ptype, struct net_device *orig_dev)
{ {
struct irlap_info info; struct irlap_info info;
struct irlap_cb *self; struct irlap_cb *self;

View file

@ -54,7 +54,7 @@ extern int irsock_init(void);
extern void irsock_cleanup(void); extern void irsock_cleanup(void);
/* irlap_frame.c */ /* irlap_frame.c */
extern int irlap_driver_rcv(struct sk_buff *, struct net_device *, extern int irlap_driver_rcv(struct sk_buff *, struct net_device *,
struct packet_type *); struct packet_type *, struct net_device *);
/* /*
* Module parameters * Module parameters

View file

@ -103,7 +103,8 @@ out:
struct llc_sap *llc_sap_open(unsigned char lsap, struct llc_sap *llc_sap_open(unsigned char lsap,
int (*func)(struct sk_buff *skb, int (*func)(struct sk_buff *skb,
struct net_device *dev, struct net_device *dev,
struct packet_type *pt)) struct packet_type *pt,
struct net_device *orig_dev))
{ {
struct llc_sap *sap = llc_sap_find(lsap); struct llc_sap *sap = llc_sap_find(lsap);

View file

@ -132,7 +132,7 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
* data now), it queues this frame in the connection's backlog. * data now), it queues this frame in the connection's backlog.
*/ */
int llc_rcv(struct sk_buff *skb, struct net_device *dev, int llc_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt) struct packet_type *pt, struct net_device *orig_dev)
{ {
struct llc_sap *sap; struct llc_sap *sap;
struct llc_pdu_sn *pdu; struct llc_pdu_sn *pdu;
@ -165,7 +165,7 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
* LLC functionality * LLC functionality
*/ */
if (sap->rcv_func) { if (sap->rcv_func) {
sap->rcv_func(skb, dev, pt); sap->rcv_func(skb, dev, pt, orig_dev);
goto out; goto out;
} }
dest = llc_pdu_type(skb); dest = llc_pdu_type(skb);

View file

@ -64,7 +64,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
ip_rcv(skb, skb->dev, NULL); ip_rcv(skb, skb->dev, NULL, skb->dev);
return 1; return 1;
} }

View file

@ -241,7 +241,7 @@ static struct proto_ops packet_ops;
#ifdef CONFIG_SOCK_PACKET #ifdef CONFIG_SOCK_PACKET
static struct proto_ops packet_ops_spkt; static struct proto_ops packet_ops_spkt;
static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct sock *sk; struct sock *sk;
struct sockaddr_pkt *spkt; struct sockaddr_pkt *spkt;
@ -441,7 +441,7 @@ static inline unsigned run_filter(struct sk_buff *skb, struct sock *sk, unsigned
we will not harm anyone. we will not harm anyone.
*/ */
static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct sock *sk; struct sock *sk;
struct sockaddr_ll *sll; struct sockaddr_ll *sll;
@ -546,7 +546,7 @@ drop:
} }
#ifdef CONFIG_PACKET_MMAP #ifdef CONFIG_PACKET_MMAP
static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
{ {
struct sock *sk; struct sock *sk;
struct packet_sock *po; struct packet_sock *po;

View file

@ -81,7 +81,7 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
} }
int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev, int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype) struct packet_type *ptype, struct net_device *orig_dev)
{ {
struct sk_buff *nskb; struct sk_buff *nskb;
struct x25_neigh *nb; struct x25_neigh *nb;