diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-27 12:29:59 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:30:45 -0500 |
commit | 4c0a6cb0db19de411c4bf7fcdc79d4c7c4ccafb1 (patch) | |
tree | e7f793f8d259df2a37fa975325c25961a5d3e14b /include/net/udp.h | |
parent | e3703b3de1f049b38733ba520e5038f23063068e (diff) |
[UDP(-Lite)]: consolidate v4 and v6 get|setsockopt code
This patch consolidates set/getsockopt code between UDP(-Lite) v4 and 6. The
justification is that UDP(-Lite) is a transport-layer protocol and therefore
the socket option code (at least in theory) should be AF-independent.
Furthermore, there is the following code reduplication:
* do_udp{,v6}_getsockopt is 100% identical between v4 and v6
* do_udp{,v6}_setsockopt is identical up to the following differerence
--v4 in contrast to v4 additionally allows the experimental encapsulation
types UDP_ENCAP_ESPINUDP and UDP_ENCAP_ESPINUDP_NON_IKE
--the remainder is identical between v4 and v6
I believe that this difference is of little relevance.
The advantages in not duplicating twice almost completely identical code.
The patch further simplifies the interface of udp{,v6}_push_pending_frames,
since for the second argument (struct udp_sock *up) it always holds that
up = udp_sk(sk); where sk is the first function argument.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index eac69ff0582c..1548d68d45da 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -134,6 +134,11 @@ extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); | |||
134 | extern int udp_disconnect(struct sock *sk, int flags); | 134 | extern int udp_disconnect(struct sock *sk, int flags); |
135 | extern unsigned int udp_poll(struct file *file, struct socket *sock, | 135 | extern unsigned int udp_poll(struct file *file, struct socket *sock, |
136 | poll_table *wait); | 136 | poll_table *wait); |
137 | extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, | ||
138 | char __user *optval, int __user *optlen); | ||
139 | extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | ||
140 | char __user *optval, int optlen, | ||
141 | int (*push_pending_frames)(struct sock *)); | ||
137 | 142 | ||
138 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); | 143 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); |
139 | /* | 144 | /* |