This reduces the diff with relayd/agentx.c.

Ok?

Index: agentx.c
===================================================================
RCS file: /cvs/src/usr.sbin/snmpd/agentx.c,v
retrieving revision 1.11
diff -u -p -r1.11 agentx.c
--- agentx.c    5 Jan 2018 08:13:32 -0000       1.11
+++ agentx.c    12 Feb 2018 19:59:57 -0000
@@ -18,12 +18,8 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/queue.h>
-#include <sys/uio.h>
 #include <sys/un.h>
 
-#include <arpa/inet.h>
-
-#include <err.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -341,7 +337,7 @@ snmp_agentx_recv(struct agentx_handle *h
        if (h->r == NULL) {
                if ((h->r = snmp_agentx_pdu_alloc()) == NULL)
                        return (NULL);
-               h->r->datalen = 0;      /* XXX -- force this for receive 
buffers */
+               h->r->datalen = 0;      /* XXX force this for receive buffers */
        }
        pdu = h->r;
 
@@ -962,7 +958,8 @@ snmp_agentx_do_read_oid(struct agentx_pd
 }
 
 int
-snmp_agentx_read_searchrange(struct agentx_pdu *pdu, struct 
agentx_search_range *sr)
+snmp_agentx_read_searchrange(struct agentx_pdu *pdu,
+    struct agentx_search_range *sr)
 {
        if (snmp_agentx_do_read_oid(pdu, &sr->start, &sr->include) == -1 ||
            snmp_agentx_read_oid(pdu, &sr->end) == -1)
@@ -1037,7 +1034,7 @@ snmp_oid2string(struct snmp_oid *o, char
        bzero(buf, len);
 
        for (i = 0; i < o->o_n; i++) {
-               snprintf(str, sizeof(str), "%d", o->o_id[i]);
+               snprintf(str, sizeof(str), "%u", o->o_id[i]);
                strlcat(buf, str, len);
                if (i < (o->o_n - 1))
                        strlcat(buf, ".", len);
@@ -1124,7 +1121,7 @@ snmp_agentx_dump_hdr(struct agentx_hdr *
                return;
        }
 
-       fprintf(stderr, 
+       fprintf(stderr,
            "agentx: version %d type %s flags %d reserved %d"
            " sessionid %d transactid %d packetid %d length %d",
            hdr->version, snmp_agentx_type2name(hdr->type), hdr->flags,

Reply via email to