Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libipsec typo



details:   https://anonhg.NetBSD.org/src/rev/587517d7444c
branches:  trunk
changeset: 550942:587517d7444c
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Aug 26 03:37:25 2003 +0000

description:
typo

diffstat:

 lib/libipsec/pfkey.c      |   53 +++++++++++-----------
 lib/libipsec/pfkey_dump.c |  108 +++++++++++++++++++++++-----------------------
 2 files changed, 81 insertions(+), 80 deletions(-)

diffs (truncated from 377 to 300 lines):

diff -r 49ce35a31101 -r 587517d7444c lib/libipsec/pfkey.c
--- a/lib/libipsec/pfkey.c      Tue Aug 26 03:31:50 2003 +0000
+++ b/lib/libipsec/pfkey.c      Tue Aug 26 03:37:25 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pfkey.c,v 1.16 2003/07/22 03:31:44 itojun Exp $        */
+/*     $NetBSD: pfkey.c,v 1.17 2003/08/26 03:37:25 itojun Exp $        */
 /*     $KAME: pfkey.c,v 1.43 2003/06/27 07:09:00 itojun Exp $  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pfkey.c,v 1.16 2003/07/22 03:31:44 itojun Exp $");
+__RCSID("$NetBSD: pfkey.c,v 1.17 2003/08/26 03:37:25 itojun Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -338,7 +338,7 @@
  * sending SADB_GETSPI message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_getspi(so, satype, mode, src, dst, min, max, reqid, seq)
@@ -467,7 +467,7 @@
  * The length of key material is a_keylen + e_keylen.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_update(so, satype, mode, src, dst, spi, reqid, wsize,
@@ -498,7 +498,7 @@
  * The length of key material is a_keylen + e_keylen.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_add(so, satype, mode, src, dst, spi, reqid, wsize,
@@ -528,7 +528,7 @@
  * sending SADB_DELETE message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_delete(so, satype, mode, src, dst, spi)
@@ -551,7 +551,7 @@
  *
  * OUT:
  *     positive: success and return length sent
- *     -1      : error occurred, and set errno
+ *     -1      : error occured, and set errno
  */
 int
 pfkey_send_delete_all(so, satype, mode, src, dst)
@@ -633,7 +633,7 @@
  * sending SADB_GET message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_get(so, satype, mode, src, dst, spi)
@@ -653,7 +653,7 @@
  * sending SADB_REGISTER message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_register(so, satype)
@@ -695,7 +695,7 @@
  * sadb_supported returned into ipsec_supported.
  * OUT:
  *      0: success and return length sent.
- *     -1: error occurred, and set errno.
+ *     -1: error occured, and set errno.
  */
 int
 pfkey_recv_register(so)
@@ -735,7 +735,7 @@
  *     tlen: msg length, it's to makeing sure.
  * OUT:
  *      0: success and return length sent.
- *     -1: error occurred, and set errno.
+ *     -1: error occured, and set errno.
  */
 int
 pfkey_set_supported(msg, tlen)
@@ -799,7 +799,7 @@
  * sending SADB_FLUSH message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_flush(so, satype)
@@ -818,7 +818,7 @@
  * sending SADB_DUMP message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_dump(so, satype)
@@ -840,8 +840,8 @@
  *     flag:   set promisc off if zero, set promisc on if non-zero.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
- *     0     : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
+ *     0     : error occured, and set errno.
  *     others: a pointer to new allocated buffer in which supported
  *             algorithms is.
  */
@@ -862,7 +862,7 @@
  * sending SADB_X_SPDADD message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spdadd(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
@@ -888,7 +888,7 @@
  * sending SADB_X_SPDADD message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spdadd2(so, src, prefs, dst, prefd, proto, ltime, vtime,
@@ -916,7 +916,7 @@
  * sending SADB_X_SPDUPDATE message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spdupdate(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
@@ -942,7 +942,7 @@
  * sending SADB_X_SPDUPDATE message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spdupdate2(so, src, prefs, dst, prefd, proto, ltime, vtime,
@@ -970,7 +970,7 @@
  * sending SADB_X_SPDDELETE message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spddelete(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
@@ -1001,7 +1001,7 @@
  * sending SADB_X_SPDDELETE message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spddelete2(so, spid)
@@ -1020,7 +1020,7 @@
  * sending SADB_X_SPDGET message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spdget(so, spid)
@@ -1039,7 +1039,7 @@
  * sending SADB_X_SPDSETIDX message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spdsetidx(so, src, prefs, dst, prefd, proto, policy, policylen, seq)
@@ -1070,7 +1070,7 @@
  * sending SADB_SPDFLUSH message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spdflush(so)
@@ -1088,7 +1088,7 @@
  * sending SADB_SPDDUMP message to the kernel.
  * OUT:
  *     positive: success and return length sent.
- *     -1      : error occurred, and set errno.
+ *     -1      : error occured, and set errno.
  */
 int
 pfkey_send_spddump(so)
@@ -1607,7 +1607,7 @@
  * receive sadb_msg data, and return pointer to new buffer allocated.
  * Must free this buffer later.
  * OUT:
- *     NULL    : error occurred.
+ *     NULL    : error occured.
  *     others  : a pointer to sadb_msg structure.
  *
  * XXX should be rewritten to pass length explicitly
@@ -1765,6 +1765,7 @@
                case SADB_EXT_SPIRANGE:
                case SADB_X_EXT_POLICY:
                case SADB_X_EXT_SA2:
+               case SADB_X_EXT_TAG:
                        mhp[ext->sadb_ext_type] = (caddr_t)ext;
                        break;
                default:
diff -r 49ce35a31101 -r 587517d7444c lib/libipsec/pfkey_dump.c
--- a/lib/libipsec/pfkey_dump.c Tue Aug 26 03:31:50 2003 +0000
+++ b/lib/libipsec/pfkey_dump.c Tue Aug 26 03:37:25 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pfkey_dump.c,v 1.14 2003/07/25 10:06:09 itojun Exp $   */
+/*     $NetBSD: pfkey_dump.c,v 1.15 2003/08/26 03:37:25 itojun Exp $   */
 /*     $KAME: pfkey_dump.c,v 1.44 2003/07/25 09:35:28 itojun Exp $     */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pfkey_dump.c,v 1.14 2003/07/25 10:06:09 itojun Exp $");
+__RCSID("$NetBSD: pfkey_dump.c,v 1.15 2003/08/26 03:37:25 itojun Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -326,6 +326,7 @@
        char pbuf[NI_MAXSERV];
        caddr_t mhp[SADB_EXT_MAX + 1];
        struct sadb_address *m_saddr, *m_daddr;
+       struct sadb_x_tag *m_tag;
        struct sadb_x_policy *m_xpl;
        struct sadb_lifetime *m_lftc = NULL, *m_lfth = NULL;
        struct sockaddr *sa;
@@ -343,64 +344,63 @@
 
        m_saddr = (struct sadb_address *)mhp[SADB_EXT_ADDRESS_SRC];
        m_daddr = (struct sadb_address *)mhp[SADB_EXT_ADDRESS_DST];
+       m_tag = (struct sadb_x_tag *)mhp[SADB_X_EXT_TAG];
        m_xpl = (struct sadb_x_policy *)mhp[SADB_X_EXT_POLICY];
        m_lftc = (struct sadb_lifetime *)mhp[SADB_EXT_LIFETIME_CURRENT];
        m_lfth = (struct sadb_lifetime *)mhp[SADB_EXT_LIFETIME_HARD];
 
-       /* source address */
-       if (m_saddr == NULL) {
-               printf("no ADDRESS_SRC extension.\n");
-               return;
-       }
-       sa = (struct sockaddr *)(m_saddr + 1);
-       switch (sa->sa_family) {
-       case AF_INET:
-       case AF_INET6:
-               if (getnameinfo(sa, sa->sa_len, NULL, 0, pbuf, sizeof(pbuf),
-                   NI_NUMERICSERV) != 0)
-                       sport = 0;      /*XXX*/
-               else
-                       sport = atoi(pbuf);
-               printf("%s%s ", str_ipaddr(sa),
-                       str_prefport(sa->sa_family,
-                           m_saddr->sadb_address_prefixlen, sport,
-                           m_saddr->sadb_address_proto));
-               break;
-       default:
-               printf("unknown-af ");
-               break;
+       if (m_saddr && m_daddr) {
+               /* source address */
+               sa = (struct sockaddr *)(m_saddr + 1);
+               switch (sa->sa_family) {
+               case AF_INET:
+               case AF_INET6:
+                       if (getnameinfo(sa, sa->sa_len, NULL, 0,
+                           pbuf, sizeof(pbuf), NI_NUMERICSERV) != 0)



Home | Main Index | Thread Index | Old Index