[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
+1 -1
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;
+4 -7
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);
+1 -1
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__
+2 -3
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");
+2 -2
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;
+4 -2
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;
+1 -1
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)
+1 -1
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;
+1 -1
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;
-1
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);
+6 -4
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;
}; };
-2
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;
+1 -1
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,
+1 -1
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);
+1 -1
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;
+1 -1
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);
+2 -1
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
+5 -3
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);
+2 -1
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
+1 -1
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

Some files were not shown because too many files have changed in this diff Show More