Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
362807fc
Commit
362807fc
authored
May 19, 2003
by
Hideaki Yoshifuji
Committed by
David S. Miller
May 19, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6]: Move NIP6 macro into general header.
parent
fa7c9b64
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
79 deletions
+20
-79
include/linux/kernel.h
include/linux/kernel.h
+10
-0
net/ipv6/ah6.c
net/ipv6/ah6.c
+0
-11
net/ipv6/esp6.c
net/ipv6/esp6.c
+0
-11
net/ipv6/icmp.c
net/ipv6/icmp.c
+1
-16
net/ipv6/ipcomp6.c
net/ipv6/ipcomp6.c
+0
-11
net/ipv6/netfilter/ip6t_LOG.c
net/ipv6/netfilter/ip6t_LOG.c
+0
-10
net/sctp/ipv6.c
net/sctp/ipv6.c
+9
-20
No files found.
include/linux/kernel.h
View file @
362807fc
...
...
@@ -134,6 +134,16 @@ extern void dump_stack(void);
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[3]
#define NIP6(addr) \
ntohs((addr).s6_addr16[0]), \
ntohs((addr).s6_addr16[1]), \
ntohs((addr).s6_addr16[2]), \
ntohs((addr).s6_addr16[3]), \
ntohs((addr).s6_addr16[4]), \
ntohs((addr).s6_addr16[5]), \
ntohs((addr).s6_addr16[6]), \
ntohs((addr).s6_addr16[7])
#if defined(__LITTLE_ENDIAN)
#define HIPQUAD(addr) \
((unsigned char *)&addr)[3], \
...
...
net/ipv6/ah6.c
View file @
362807fc
...
...
@@ -36,17 +36,6 @@
#include <net/xfrm.h>
#include <asm/scatterlist.h>
/* XXX no ipv6 ah specific */
#define NIP6(addr) \
ntohs((addr).s6_addr16[0]),\
ntohs((addr).s6_addr16[1]),\
ntohs((addr).s6_addr16[2]),\
ntohs((addr).s6_addr16[3]),\
ntohs((addr).s6_addr16[4]),\
ntohs((addr).s6_addr16[5]),\
ntohs((addr).s6_addr16[6]),\
ntohs((addr).s6_addr16[7])
int
ah6_output
(
struct
sk_buff
*
skb
)
{
int
err
;
...
...
net/ipv6/esp6.c
View file @
362807fc
...
...
@@ -46,17 +46,6 @@
/* Move to common area: it is shared with AH. */
/* Common with AH after some work on arguments. */
/* XXX no ipv6 esp specific */
#define NIP6(addr) \
ntohs((addr).s6_addr16[0]),\
ntohs((addr).s6_addr16[1]),\
ntohs((addr).s6_addr16[2]),\
ntohs((addr).s6_addr16[3]),\
ntohs((addr).s6_addr16[4]),\
ntohs((addr).s6_addr16[5]),\
ntohs((addr).s6_addr16[6]),\
ntohs((addr).s6_addr16[7])
static
int
get_offset
(
u8
*
packet
,
u32
packet_len
,
u8
*
nexthdr
,
struct
ipv6_opt_hdr
**
prevhdr
)
{
u16
offset
=
sizeof
(
struct
ipv6hdr
);
...
...
net/ipv6/icmp.c
View file @
362807fc
...
...
@@ -557,22 +557,7 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
skb_checksum
(
skb
,
0
,
skb
->
len
,
0
)))
{
if
(
net_ratelimit
())
printk
(
KERN_DEBUG
"ICMPv6 checksum failed [%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x > %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]
\n
"
,
ntohs
(
saddr
->
s6_addr16
[
0
]),
ntohs
(
saddr
->
s6_addr16
[
1
]),
ntohs
(
saddr
->
s6_addr16
[
2
]),
ntohs
(
saddr
->
s6_addr16
[
3
]),
ntohs
(
saddr
->
s6_addr16
[
4
]),
ntohs
(
saddr
->
s6_addr16
[
5
]),
ntohs
(
saddr
->
s6_addr16
[
6
]),
ntohs
(
saddr
->
s6_addr16
[
7
]),
ntohs
(
daddr
->
s6_addr16
[
0
]),
ntohs
(
daddr
->
s6_addr16
[
1
]),
ntohs
(
daddr
->
s6_addr16
[
2
]),
ntohs
(
daddr
->
s6_addr16
[
3
]),
ntohs
(
daddr
->
s6_addr16
[
4
]),
ntohs
(
daddr
->
s6_addr16
[
5
]),
ntohs
(
daddr
->
s6_addr16
[
6
]),
ntohs
(
daddr
->
s6_addr16
[
7
]));
NIP6
(
*
saddr
),
NIP6
(
*
daddr
));
goto
discard_it
;
}
}
...
...
net/ipv6/ipcomp6.c
View file @
362807fc
...
...
@@ -44,17 +44,6 @@
#include <linux/ipv6.h>
#include <linux/icmpv6.h>
/* XXX no ipv6 ipcomp specific */
#define NIP6(addr) \
ntohs((addr).s6_addr16[0]),\
ntohs((addr).s6_addr16[1]),\
ntohs((addr).s6_addr16[2]),\
ntohs((addr).s6_addr16[3]),\
ntohs((addr).s6_addr16[4]),\
ntohs((addr).s6_addr16[5]),\
ntohs((addr).s6_addr16[6]),\
ntohs((addr).s6_addr16[7])
static
int
ipcomp6_input
(
struct
xfrm_state
*
x
,
struct
xfrm_decap_state
*
decap
,
struct
sk_buff
*
skb
)
{
int
err
=
0
;
...
...
net/ipv6/netfilter/ip6t_LOG.c
View file @
362807fc
...
...
@@ -25,16 +25,6 @@ struct in_device;
#define DEBUGP(format, args...)
#endif
#define NIP6(addr) \
ntohs((addr).s6_addr16[0]), \
ntohs((addr).s6_addr16[1]), \
ntohs((addr).s6_addr16[2]), \
ntohs((addr).s6_addr16[3]), \
ntohs((addr).s6_addr16[4]), \
ntohs((addr).s6_addr16[5]), \
ntohs((addr).s6_addr16[6]), \
ntohs((addr).s6_addr16[7])
struct
esphdr
{
__u32
spi
;
};
/* FIXME evil kludge */
...
...
net/sctp/ipv6.c
View file @
362807fc
...
...
@@ -77,17 +77,6 @@
extern
struct
notifier_block
sctp_inetaddr_notifier
;
/* FIXME: This macro needs to be moved to a common header file. */
#define NIP6(addr) \
ntohs((addr)->s6_addr16[0]), \
ntohs((addr)->s6_addr16[1]), \
ntohs((addr)->s6_addr16[2]), \
ntohs((addr)->s6_addr16[3]), \
ntohs((addr)->s6_addr16[4]), \
ntohs((addr)->s6_addr16[5]), \
ntohs((addr)->s6_addr16[6]), \
ntohs((addr)->s6_addr16[7])
/* ICMP error handler. */
void
sctp_v6_err
(
struct
sk_buff
*
skb
,
struct
inet6_skb_parm
*
opt
,
int
type
,
int
code
,
int
offset
,
__u32
info
)
...
...
@@ -180,8 +169,8 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
SCTP_DEBUG_PRINTK
(
"%s: skb:%p, len:%d, "
"src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
"dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x
\n
"
,
__FUNCTION__
,
skb
,
skb
->
len
,
NIP6
(
fl
.
fl6_src
),
NIP6
(
fl
.
fl6_dst
));
__FUNCTION__
,
skb
,
skb
->
len
,
NIP6
(
*
fl
.
fl6_src
),
NIP6
(
*
fl
.
fl6_dst
));
SCTP_INC_STATS
(
SctpOutSCTPPacks
);
...
...
@@ -200,13 +189,13 @@ struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
.
nl_u
=
{
.
ip6_u
=
{
.
daddr
=
&
daddr
->
v6
.
sin6_addr
,
}
}
};
SCTP_DEBUG_PRINTK
(
"%s: DST=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
,
__FUNCTION__
,
NIP6
(
fl
.
fl6_dst
));
__FUNCTION__
,
NIP6
(
*
fl
.
fl6_dst
));
if
(
saddr
)
{
fl
.
fl6_src
=
&
saddr
->
v6
.
sin6_addr
;
SCTP_DEBUG_PRINTK
(
"SRC=%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x - "
,
NIP6
(
fl
.
fl6_src
));
NIP6
(
*
fl
.
fl6_src
));
}
dst
=
ip6_route_output
(
NULL
,
&
fl
);
...
...
@@ -216,7 +205,7 @@ struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
SCTP_DEBUG_PRINTK
(
"rt6_dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
"rt6_src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x
\n
"
,
NIP6
(
&
rt
->
rt6i_dst
.
addr
),
NIP6
(
&
rt
->
rt6i_src
.
addr
));
NIP6
(
rt
->
rt6i_dst
.
addr
),
NIP6
(
rt
->
rt6i_src
.
addr
));
}
else
{
SCTP_DEBUG_PRINTK
(
"NO ROUTE
\n
"
);
}
...
...
@@ -263,13 +252,13 @@ void sctp_v6_get_saddr(struct sctp_association *asoc, struct dst_entry *dst,
SCTP_DEBUG_PRINTK
(
"%s: asoc:%p dst:%p "
"daddr:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
,
__FUNCTION__
,
asoc
,
dst
,
NIP6
(
&
daddr
->
v6
.
sin6_addr
));
__FUNCTION__
,
asoc
,
dst
,
NIP6
(
daddr
->
v6
.
sin6_addr
));
if
(
!
asoc
)
{
ipv6_get_saddr
(
dst
,
&
daddr
->
v6
.
sin6_addr
,
&
saddr
->
v6
.
sin6_addr
);
SCTP_DEBUG_PRINTK
(
"saddr from ipv6_get_saddr: "
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x
\n
"
,
NIP6
(
&
saddr
->
v6
.
sin6_addr
));
NIP6
(
saddr
->
v6
.
sin6_addr
));
return
;
}
...
...
@@ -298,12 +287,12 @@ void sctp_v6_get_saddr(struct sctp_association *asoc, struct dst_entry *dst,
memcpy
(
saddr
,
baddr
,
sizeof
(
union
sctp_addr
));
SCTP_DEBUG_PRINTK
(
"saddr: "
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x
\n
"
,
NIP6
(
&
saddr
->
v6
.
sin6_addr
));
NIP6
(
saddr
->
v6
.
sin6_addr
));
}
else
{
printk
(
KERN_ERR
"%s: asoc:%p Could not find a valid source "
"address for the "
"dest:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x
\n
"
,
__FUNCTION__
,
asoc
,
NIP6
(
&
daddr
->
v6
.
sin6_addr
));
__FUNCTION__
,
asoc
,
NIP6
(
daddr
->
v6
.
sin6_addr
));
}
sctp_read_unlock
(
addr_lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment