From 4a432d7fd67c332c79517fbe56ea51fb0adb62a9 Mon Sep 17 00:00:00 2001 From: Chas Williams <chas@cmf.nrl.navy.mil> Date: Thu, 11 Sep 2003 04:23:45 -0700 Subject: [PATCH] [ATM]: exporting llc_oui[] isn't worth it (from mitch@sfgoth.com) --- include/linux/atmclip.h | 4 ---- net/atm/clip.c | 7 +++++++ net/atm/ipcommon.c | 10 ---------- net/sched/sch_atm.c | 16 +++++++++++----- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/include/linux/atmclip.h b/include/linux/atmclip.h index 7d657c0dcb2d..02c94c448dd6 100644 --- a/include/linux/atmclip.h +++ b/include/linux/atmclip.h @@ -18,8 +18,4 @@ #define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */ -#ifdef __KERNEL__ -extern const unsigned char llc_oui[6]; -#endif - #endif diff --git a/net/atm/clip.c b/net/atm/clip.c index 74a58eee32fd..39f87d4d2948 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c @@ -189,6 +189,13 @@ static int clip_arp_rcv(struct sk_buff *skb) return 0; } +static const unsigned char llc_oui[] = { + 0xaa, /* DSAP: non-ISO */ + 0xaa, /* SSAP: non-ISO */ + 0x03, /* Ctrl: Unnumbered Information Command PDU */ + 0x00, /* OUI: EtherType */ + 0x00, + 0x00 }; static void clip_push(struct atm_vcc *vcc,struct sk_buff *skb) { diff --git a/net/atm/ipcommon.c b/net/atm/ipcommon.c index f939736e3797..181a3002d8ad 100644 --- a/net/atm/ipcommon.c +++ b/net/atm/ipcommon.c @@ -22,15 +22,6 @@ #endif -const unsigned char llc_oui[] = { - 0xaa, /* DSAP: non-ISO */ - 0xaa, /* SSAP: non-ISO */ - 0x03, /* Ctrl: Unnumbered Information Command PDU */ - 0x00, /* OUI: EtherType */ - 0x00, - 0x00 }; - - /* * skb_migrate appends the list at "from" to "to", emptying "from" in the * process. skb_migrate is atomic with respect to all other skb operations on @@ -67,5 +58,4 @@ void skb_migrate(struct sk_buff_head *from,struct sk_buff_head *to) } -EXPORT_SYMBOL(llc_oui); EXPORT_SYMBOL(skb_migrate); diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 8e0a87c683d1..a6d9728d3aa1 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c @@ -216,6 +216,13 @@ static void sch_atm_pop(struct atm_vcc *vcc,struct sk_buff *skb) tasklet_schedule(&p->task); } +static const u8 llc_oui_ip[] = { + 0xaa, /* DSAP: non-ISO */ + 0xaa, /* SSAP: non-ISO */ + 0x03, /* Ctrl: Unnumbered Information Command PDU */ + 0x00, /* OUI: EtherType */ + 0x00, 0x00, + 0x08, 0x00 }; /* Ethertype IP (0800) */ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, struct rtattr **tca, unsigned long *arg) @@ -322,11 +329,10 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, flow->next = p->link.next; p->link.next = flow; flow->hdr_len = hdr_len; - if (hdr) memcpy(flow->hdr,hdr,hdr_len); - else { - memcpy(flow->hdr,llc_oui,sizeof(llc_oui)); - ((u16 *) flow->hdr)[3] = htons(ETH_P_IP); - } + if (hdr) + memcpy(flow->hdr,hdr,hdr_len); + else + memcpy(flow->hdr,llc_oui_ip,sizeof(llc_oui_ip)); *arg = (unsigned long) flow; return 0; err_out: -- 2.30.9