aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ax25/ax25_subr.c2
-rw-r--r--net/bridge/br_device.c3
-rw-r--r--net/ipv4/ipconfig.c20
-rw-r--r--net/ipv4/netfilter/ip_tables.c57
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv6/ipv6_sockglue.c12
-rw-r--r--net/irda/irlmp.c1
-rw-r--r--net/irda/parameters.c6
-rw-r--r--net/netfilter/nf_conntrack_netlink.c4
-rw-r--r--net/netfilter/x_tables.c8
-rw-r--r--net/netfilter/xt_hashlimit.c2
-rw-r--r--net/sctp/ulpqueue.c33
-rw-r--r--net/tipc/socket.c2
-rw-r--r--net/xfrm/xfrm_state.c10
14 files changed, 76 insertions, 86 deletions
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c
index 5fe9b2a6697d..d8f215733175 100644
--- a/net/ax25/ax25_subr.c
+++ b/net/ax25/ax25_subr.c
@@ -279,6 +279,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
279 ax25_link_failed(ax25, reason); 279 ax25_link_failed(ax25, reason);
280 280
281 if (ax25->sk != NULL) { 281 if (ax25->sk != NULL) {
282 local_bh_disable();
282 bh_lock_sock(ax25->sk); 283 bh_lock_sock(ax25->sk);
283 ax25->sk->sk_state = TCP_CLOSE; 284 ax25->sk->sk_state = TCP_CLOSE;
284 ax25->sk->sk_err = reason; 285 ax25->sk->sk_err = reason;
@@ -288,5 +289,6 @@ void ax25_disconnect(ax25_cb *ax25, int reason)
288 sock_set_flag(ax25->sk, SOCK_DEAD); 289 sock_set_flag(ax25->sk, SOCK_DEAD);
289 } 290 }
290 bh_unlock_sock(ax25->sk); 291 bh_unlock_sock(ax25->sk);
292 local_bh_enable();
291 } 293 }
292} 294}
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index c07bac5e3e10..bf7787395fe0 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -157,8 +157,7 @@ static struct ethtool_ops br_ethtool_ops = {
157 157
158void br_dev_setup(struct net_device *dev) 158void br_dev_setup(struct net_device *dev)
159{ 159{
160 memset(dev->dev_addr, 0, ETH_ALEN); 160 random_ether_addr(dev->dev_addr);
161
162 ether_setup(dev); 161 ether_setup(dev);
163 162
164 dev->do_ioctl = br_dev_ioctl; 163 dev->do_ioctl = br_dev_ioctl;
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index c5c107a01823..96400b0bd08a 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1396,25 +1396,7 @@ late_initcall(ip_auto_config);
1396 1396
1397/* 1397/*
1398 * Decode any IP configuration options in the "ip=" or "nfsaddrs=" kernel 1398 * Decode any IP configuration options in the "ip=" or "nfsaddrs=" kernel
1399 * command line parameter. It consists of option fields separated by colons in 1399 * command line parameter. See Documentation/nfsroot.txt.
1400 * the following order:
1401 *
1402 * <client-ip>:<server-ip>:<gw-ip>:<netmask>:<host name>:<device>:<PROTO>
1403 *
1404 * Any of the fields can be empty which means to use a default value:
1405 * <client-ip> - address given by BOOTP or RARP
1406 * <server-ip> - address of host returning BOOTP or RARP packet
1407 * <gw-ip> - none, or the address returned by BOOTP
1408 * <netmask> - automatically determined from <client-ip>, or the
1409 * one returned by BOOTP
1410 * <host name> - <client-ip> in ASCII notation, or the name returned
1411 * by BOOTP
1412 * <device> - use all available devices
1413 * <PROTO>:
1414 * off|none - don't do autoconfig at all (DEFAULT)
1415 * on|any - use any configured protocol
1416 * dhcp|bootp|rarp - use only the specified protocol
1417 * both - use both BOOTP and RARP (not DHCP)
1418 */ 1400 */
1419static int __init ic_proto_name(char *name) 1401static int __init ic_proto_name(char *name)
1420{ 1402{
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 4b10b98640ac..b9b189c26208 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -1492,8 +1492,10 @@ static inline int compat_copy_match_to_user(struct ipt_entry_match *m,
1492 return xt_compat_match_to_user(m, dstptr, size); 1492 return xt_compat_match_to_user(m, dstptr, size);
1493} 1493}
1494 1494
1495static int compat_copy_entry_to_user(struct ipt_entry *e, 1495static int
1496 void __user **dstptr, compat_uint_t *size) 1496compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr,
1497 compat_uint_t *size, struct xt_counters *counters,
1498 unsigned int *i)
1497{ 1499{
1498 struct ipt_entry_target *t; 1500 struct ipt_entry_target *t;
1499 struct compat_ipt_entry __user *ce; 1501 struct compat_ipt_entry __user *ce;
@@ -1507,6 +1509,9 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
1507 if (copy_to_user(ce, e, sizeof(struct ipt_entry))) 1509 if (copy_to_user(ce, e, sizeof(struct ipt_entry)))
1508 goto out; 1510 goto out;
1509 1511
1512 if (copy_to_user(&ce->counters, &counters[*i], sizeof(counters[*i])))
1513 goto out;
1514
1510 *dstptr += sizeof(struct compat_ipt_entry); 1515 *dstptr += sizeof(struct compat_ipt_entry);
1511 ret = IPT_MATCH_ITERATE(e, compat_copy_match_to_user, dstptr, size); 1516 ret = IPT_MATCH_ITERATE(e, compat_copy_match_to_user, dstptr, size);
1512 target_offset = e->target_offset - (origsize - *size); 1517 target_offset = e->target_offset - (origsize - *size);
@@ -1522,6 +1527,8 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
1522 goto out; 1527 goto out;
1523 if (put_user(next_offset, &ce->next_offset)) 1528 if (put_user(next_offset, &ce->next_offset))
1524 goto out; 1529 goto out;
1530
1531 (*i)++;
1525 return 0; 1532 return 0;
1526out: 1533out:
1527 return ret; 1534 return ret;
@@ -1937,14 +1944,13 @@ struct compat_ipt_get_entries
1937static int compat_copy_entries_to_user(unsigned int total_size, 1944static int compat_copy_entries_to_user(unsigned int total_size,
1938 struct xt_table *table, void __user *userptr) 1945 struct xt_table *table, void __user *userptr)
1939{ 1946{
1940 unsigned int off, num;
1941 struct compat_ipt_entry e;
1942 struct xt_counters *counters; 1947 struct xt_counters *counters;
1943 struct xt_table_info *private = table->private; 1948 struct xt_table_info *private = table->private;
1944 void __user *pos; 1949 void __user *pos;
1945 unsigned int size; 1950 unsigned int size;
1946 int ret = 0; 1951 int ret = 0;
1947 void *loc_cpu_entry; 1952 void *loc_cpu_entry;
1953 unsigned int i = 0;
1948 1954
1949 counters = alloc_counters(table); 1955 counters = alloc_counters(table);
1950 if (IS_ERR(counters)) 1956 if (IS_ERR(counters))
@@ -1958,48 +1964,9 @@ static int compat_copy_entries_to_user(unsigned int total_size,
1958 pos = userptr; 1964 pos = userptr;
1959 size = total_size; 1965 size = total_size;
1960 ret = IPT_ENTRY_ITERATE(loc_cpu_entry, total_size, 1966 ret = IPT_ENTRY_ITERATE(loc_cpu_entry, total_size,
1961 compat_copy_entry_to_user, &pos, &size); 1967 compat_copy_entry_to_user,
1962 if (ret) 1968 &pos, &size, counters, &i);
1963 goto free_counters;
1964
1965 /* ... then go back and fix counters and names */
1966 for (off = 0, num = 0; off < size; off += e.next_offset, num++) {
1967 unsigned int i;
1968 struct ipt_entry_match m;
1969 struct ipt_entry_target t;
1970 1969
1971 ret = -EFAULT;
1972 if (copy_from_user(&e, userptr + off,
1973 sizeof(struct compat_ipt_entry)))
1974 goto free_counters;
1975 if (copy_to_user(userptr + off +
1976 offsetof(struct compat_ipt_entry, counters),
1977 &counters[num], sizeof(counters[num])))
1978 goto free_counters;
1979
1980 for (i = sizeof(struct compat_ipt_entry);
1981 i < e.target_offset; i += m.u.match_size) {
1982 if (copy_from_user(&m, userptr + off + i,
1983 sizeof(struct ipt_entry_match)))
1984 goto free_counters;
1985 if (copy_to_user(userptr + off + i +
1986 offsetof(struct ipt_entry_match, u.user.name),
1987 m.u.kernel.match->name,
1988 strlen(m.u.kernel.match->name) + 1))
1989 goto free_counters;
1990 }
1991
1992 if (copy_from_user(&t, userptr + off + e.target_offset,
1993 sizeof(struct ipt_entry_target)))
1994 goto free_counters;
1995 if (copy_to_user(userptr + off + e.target_offset +
1996 offsetof(struct ipt_entry_target, u.user.name),
1997 t.u.kernel.target->name,
1998 strlen(t.u.kernel.target->name) + 1))
1999 goto free_counters;
2000 }
2001 ret = 0;
2002free_counters:
2003 vfree(counters); 1970 vfree(counters);
2004 return ret; 1971 return ret;
2005} 1972}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index b9e429d2d1de..889c89362bfc 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -923,7 +923,7 @@ static void tcp_init_metrics(struct sock *sk)
923 } 923 }
924 if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) { 924 if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) {
925 tp->mdev = dst_metric(dst, RTAX_RTTVAR); 925 tp->mdev = dst_metric(dst, RTAX_RTTVAR);
926 tp->mdev_max = tp->rttvar = max(tp->mdev, TCP_RTO_MIN); 926 tp->mdev_max = tp->rttvar = max(tp->mdev, tcp_rto_min(sk));
927 } 927 }
928 tcp_set_rto(sk); 928 tcp_set_rto(sk);
929 tcp_bound_rto(sk); 929 tcp_bound_rto(sk);
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 1334fc174bcf..8c5f80fd03ad 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -1046,7 +1046,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
1046 break; 1046 break;
1047 1047
1048 default: 1048 default:
1049 return -EINVAL; 1049 return -ENOPROTOOPT;
1050 } 1050 }
1051 len = min_t(unsigned int, sizeof(int), len); 1051 len = min_t(unsigned int, sizeof(int), len);
1052 if(put_user(len, optlen)) 1052 if(put_user(len, optlen))
@@ -1069,9 +1069,8 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
1069 1069
1070 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); 1070 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
1071#ifdef CONFIG_NETFILTER 1071#ifdef CONFIG_NETFILTER
1072 /* we need to exclude all possible EINVALs except default case */ 1072 /* we need to exclude all possible ENOPROTOOPTs except default case */
1073 if (err == -EINVAL && optname != IPV6_ADDRFORM && 1073 if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) {
1074 optname != MCAST_MSFILTER) {
1075 int len; 1074 int len;
1076 1075
1077 if (get_user(len, optlen)) 1076 if (get_user(len, optlen))
@@ -1108,9 +1107,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
1108 1107
1109 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); 1108 err = do_ipv6_getsockopt(sk, level, optname, optval, optlen);
1110#ifdef CONFIG_NETFILTER 1109#ifdef CONFIG_NETFILTER
1111 /* we need to exclude all possible EINVALs except default case */ 1110 /* we need to exclude all possible ENOPROTOOPTs except default case */
1112 if (err == -EINVAL && optname != IPV6_ADDRFORM && 1111 if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) {
1113 optname != MCAST_MSFILTER) {
1114 int len; 1112 int len;
1115 1113
1116 if (get_user(len, optlen)) 1114 if (get_user(len, optlen))
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index cedff8068fbc..f24cb755908e 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -353,6 +353,7 @@ void irlmp_unregister_link(__u32 saddr)
353 /* Final cleanup */ 353 /* Final cleanup */
354 del_timer(&link->idle_timer); 354 del_timer(&link->idle_timer);
355 link->magic = 0; 355 link->magic = 0;
356 hashbin_delete(link->lsaps, (FREE_FUNC) __irlmp_close_lsap);
356 kfree(link); 357 kfree(link);
357 } 358 }
358} 359}
diff --git a/net/irda/parameters.c b/net/irda/parameters.c
index 2627dad7cd87..7183e9ef7996 100644
--- a/net/irda/parameters.c
+++ b/net/irda/parameters.c
@@ -463,7 +463,7 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len,
463 int n = 0; 463 int n = 0;
464 464
465 IRDA_ASSERT(buf != NULL, return ret;); 465 IRDA_ASSERT(buf != NULL, return ret;);
466 IRDA_ASSERT(info != 0, return ret;); 466 IRDA_ASSERT(info != NULL, return ret;);
467 467
468 pi_minor = pi & info->pi_mask; 468 pi_minor = pi & info->pi_mask;
469 pi_major = pi >> info->pi_major_offset; 469 pi_major = pi >> info->pi_major_offset;
@@ -517,7 +517,7 @@ static int irda_param_extract(void *self, __u8 *buf, int len,
517 int n = 0; 517 int n = 0;
518 518
519 IRDA_ASSERT(buf != NULL, return ret;); 519 IRDA_ASSERT(buf != NULL, return ret;);
520 IRDA_ASSERT(info != 0, return ret;); 520 IRDA_ASSERT(info != NULL, return ret;);
521 521
522 pi_minor = buf[n] & info->pi_mask; 522 pi_minor = buf[n] & info->pi_mask;
523 pi_major = buf[n] >> info->pi_major_offset; 523 pi_major = buf[n] >> info->pi_major_offset;
@@ -570,7 +570,7 @@ int irda_param_extract_all(void *self, __u8 *buf, int len,
570 int n = 0; 570 int n = 0;
571 571
572 IRDA_ASSERT(buf != NULL, return ret;); 572 IRDA_ASSERT(buf != NULL, return ret;);
573 IRDA_ASSERT(info != 0, return ret;); 573 IRDA_ASSERT(info != NULL, return ret;);
574 574
575 /* 575 /*
576 * Parse all parameters. Each parameter must be at least two bytes 576 * Parse all parameters. Each parameter must be at least two bytes
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 9be1826e6cdd..7d231243754a 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1024,8 +1024,10 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
1024 } 1024 }
1025 1025
1026 /* setup master conntrack: this is a confirmed expectation */ 1026 /* setup master conntrack: this is a confirmed expectation */
1027 if (master_ct) 1027 if (master_ct) {
1028 __set_bit(IPS_EXPECTED_BIT, &ct->status);
1028 ct->master = master_ct; 1029 ct->master = master_ct;
1030 }
1029 1031
1030 add_timer(&ct->timeout); 1032 add_timer(&ct->timeout);
1031 nf_conntrack_hash_insert(ct); 1033 nf_conntrack_hash_insert(ct);
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index d9a3bded0d00..b6160e41eb1c 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -377,7 +377,9 @@ int xt_compat_match_to_user(struct xt_entry_match *m, void __user **dstptr,
377 u_int16_t msize = m->u.user.match_size - off; 377 u_int16_t msize = m->u.user.match_size - off;
378 378
379 if (copy_to_user(cm, m, sizeof(*cm)) || 379 if (copy_to_user(cm, m, sizeof(*cm)) ||
380 put_user(msize, &cm->u.user.match_size)) 380 put_user(msize, &cm->u.user.match_size) ||
381 copy_to_user(cm->u.user.name, m->u.kernel.match->name,
382 strlen(m->u.kernel.match->name) + 1))
381 return -EFAULT; 383 return -EFAULT;
382 384
383 if (match->compat_to_user) { 385 if (match->compat_to_user) {
@@ -468,7 +470,9 @@ int xt_compat_target_to_user(struct xt_entry_target *t, void __user **dstptr,
468 u_int16_t tsize = t->u.user.target_size - off; 470 u_int16_t tsize = t->u.user.target_size - off;
469 471
470 if (copy_to_user(ct, t, sizeof(*ct)) || 472 if (copy_to_user(ct, t, sizeof(*ct)) ||
471 put_user(tsize, &ct->u.user.target_size)) 473 put_user(tsize, &ct->u.user.target_size) ||
474 copy_to_user(ct->u.user.name, t->u.kernel.target->name,
475 strlen(t->u.kernel.target->name) + 1))
472 return -EFAULT; 476 return -EFAULT;
473 477
474 if (target->compat_to_user) { 478 if (target->compat_to_user) {
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 19103678bf20..2ef44d8560c1 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -240,7 +240,7 @@ static bool select_all(const struct xt_hashlimit_htable *ht,
240static bool select_gc(const struct xt_hashlimit_htable *ht, 240static bool select_gc(const struct xt_hashlimit_htable *ht,
241 const struct dsthash_ent *he) 241 const struct dsthash_ent *he)
242{ 242{
243 return jiffies >= he->expires; 243 return time_after_eq(jiffies, he->expires);
244} 244}
245 245
246static void htable_selective_cleanup(struct xt_hashlimit_htable *ht, 246static void htable_selective_cleanup(struct xt_hashlimit_htable *ht,
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 4908041ffb31..1733fa29a501 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -53,6 +53,7 @@ static struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
53 struct sctp_ulpevent *); 53 struct sctp_ulpevent *);
54static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *, 54static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *,
55 struct sctp_ulpevent *); 55 struct sctp_ulpevent *);
56static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq);
56 57
57/* 1st Level Abstractions */ 58/* 1st Level Abstractions */
58 59
@@ -190,6 +191,7 @@ static void sctp_ulpq_set_pd(struct sctp_ulpq *ulpq)
190static int sctp_ulpq_clear_pd(struct sctp_ulpq *ulpq) 191static int sctp_ulpq_clear_pd(struct sctp_ulpq *ulpq)
191{ 192{
192 ulpq->pd_mode = 0; 193 ulpq->pd_mode = 0;
194 sctp_ulpq_reasm_drain(ulpq);
193 return sctp_clear_pd(ulpq->asoc->base.sk, ulpq->asoc); 195 return sctp_clear_pd(ulpq->asoc->base.sk, ulpq->asoc);
194} 196}
195 197
@@ -699,6 +701,37 @@ void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *ulpq, __u32 fwd_tsn)
699 } 701 }
700} 702}
701 703
704/*
705 * Drain the reassembly queue. If we just cleared parted delivery, it
706 * is possible that the reassembly queue will contain already reassembled
707 * messages. Retrieve any such messages and give them to the user.
708 */
709static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq)
710{
711 struct sctp_ulpevent *event = NULL;
712 struct sk_buff_head temp;
713
714 if (skb_queue_empty(&ulpq->reasm))
715 return;
716
717 while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) {
718 /* Do ordering if needed. */
719 if ((event) && (event->msg_flags & MSG_EOR)){
720 skb_queue_head_init(&temp);
721 __skb_queue_tail(&temp, sctp_event2skb(event));
722
723 event = sctp_ulpq_order(ulpq, event);
724 }
725
726 /* Send event to the ULP. 'event' is the
727 * sctp_ulpevent for very first SKB on the temp' list.
728 */
729 if (event)
730 sctp_ulpq_tail_event(ulpq, event);
731 }
732}
733
734
702/* Helper function to gather skbs that have possibly become 735/* Helper function to gather skbs that have possibly become
703 * ordered by an an incoming chunk. 736 * ordered by an an incoming chunk.
704 */ 737 */
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 6b792265dc06..24ddfd2ca38b 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -253,7 +253,7 @@ static int release(struct socket *sock)
253 dbg("sock_delete: %x\n",tsock); 253 dbg("sock_delete: %x\n",tsock);
254 if (!tsock) 254 if (!tsock)
255 return 0; 255 return 0;
256 down_interruptible(&tsock->sem); 256 down(&tsock->sem);
257 if (!sock->sk) { 257 if (!sock->sk) {
258 up(&tsock->sem); 258 up(&tsock->sem);
259 return 0; 259 return 0;
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index cf43c49eab37..1af522bf12ca 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -2028,6 +2028,7 @@ void
2028xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid) 2028xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid)
2029{ 2029{
2030 struct audit_buffer *audit_buf; 2030 struct audit_buffer *audit_buf;
2031 u32 spi;
2031 extern int audit_enabled; 2032 extern int audit_enabled;
2032 2033
2033 if (audit_enabled == 0) 2034 if (audit_enabled == 0)
@@ -2037,8 +2038,8 @@ xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid)
2037 return; 2038 return;
2038 audit_log_format(audit_buf, " op=SAD-add res=%u",result); 2039 audit_log_format(audit_buf, " op=SAD-add res=%u",result);
2039 xfrm_audit_common_stateinfo(x, audit_buf); 2040 xfrm_audit_common_stateinfo(x, audit_buf);
2040 audit_log_format(audit_buf, " spi=%lu(0x%lx)", 2041 spi = ntohl(x->id.spi);
2041 (unsigned long)x->id.spi, (unsigned long)x->id.spi); 2042 audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi);
2042 audit_log_end(audit_buf); 2043 audit_log_end(audit_buf);
2043} 2044}
2044EXPORT_SYMBOL_GPL(xfrm_audit_state_add); 2045EXPORT_SYMBOL_GPL(xfrm_audit_state_add);
@@ -2047,6 +2048,7 @@ void
2047xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid) 2048xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid)
2048{ 2049{
2049 struct audit_buffer *audit_buf; 2050 struct audit_buffer *audit_buf;
2051 u32 spi;
2050 extern int audit_enabled; 2052 extern int audit_enabled;
2051 2053
2052 if (audit_enabled == 0) 2054 if (audit_enabled == 0)
@@ -2056,8 +2058,8 @@ xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid)
2056 return; 2058 return;
2057 audit_log_format(audit_buf, " op=SAD-delete res=%u",result); 2059 audit_log_format(audit_buf, " op=SAD-delete res=%u",result);
2058 xfrm_audit_common_stateinfo(x, audit_buf); 2060 xfrm_audit_common_stateinfo(x, audit_buf);
2059 audit_log_format(audit_buf, " spi=%lu(0x%lx)", 2061 spi = ntohl(x->id.spi);
2060 (unsigned long)x->id.spi, (unsigned long)x->id.spi); 2062 audit_log_format(audit_buf, " spi=%u(0x%x)", spi, spi);
2061 audit_log_end(audit_buf); 2063 audit_log_end(audit_buf);
2062} 2064}
2063EXPORT_SYMBOL_GPL(xfrm_audit_state_delete); 2065EXPORT_SYMBOL_GPL(xfrm_audit_state_delete);