aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/rrd.c
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-12-30 07:25:39 -0600
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-12-30 07:25:39 -0600
commit86ba931697790d4da2515f4457ebfb3f20b43860 (patch)
tree839c1f7ae94fd32639d3311c3a2faee34f88f04c /src/bin/rrd.c
parent05d677a3d3e9e540dffd35c76e35335bf43ead7d (diff)
downloadmisc-86ba931697790d4da2515f4457ebfb3f20b43860.tar.gz
misc-86ba931697790d4da2515f4457ebfb3f20b43860.zip
all those .c changes were mostly fixes of warnings for the change in rebuild.sh being changed to use -Wall.
gethostbyname was almost completely rewritten to work better with ipv6 for gopherd.sh gopherd.sh was rewritten to use gethostbyname instead of dig and to cut out any link-local interface indicators from the output of hop0 and to ignore an error if ipA -> hostname -> ipB causes ipA to be not the same as ipB. Don't remember if there's anything else.
Diffstat (limited to 'src/bin/rrd.c')
-rw-r--r--src/bin/rrd.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/bin/rrd.c b/src/bin/rrd.c
index 1b43426..067fede 100644
--- a/src/bin/rrd.c
+++ b/src/bin/rrd.c
@@ -2,7 +2,6 @@
#include <stdlib.h>
#include <sys/sysctl.h>
#include <net/route.h>
-
#include <sys/socket.h>
#include <netinet/in.h>
@@ -11,7 +10,7 @@ mostly ripped. just outputs routes from KRT on NetBSD.
used to look closer at a difference of output from route and netstat.
*/
-get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info)
+void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info)
{
int i;
@@ -29,7 +28,7 @@ get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info)
void print_sa6(struct sockaddr *sa) {
int i=0;
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
- struct in6_addr *in6 = &sa6->sin6_addr;
+ struct in6_addr *in6 = &(sa6->sin6_addr);
if(sa) {
for(i=0;i<16;i++) {
printf("%02x",(unsigned char)in6->s6_addr[i]);
@@ -44,11 +43,10 @@ void print_sa6(struct sockaddr *sa) {
}
void p_rtentry(struct rt_msghdr *rtm) {
- struct sockadrr *sa = (rtm+1);
+ struct sockadrr *sa;
+ sa = (struct sockaddr *)(rtm+1);
struct sockaddr *rti_info[RTAX_MAX];
- struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
- struct in6_addr *in6 = &sa6->sin6_addr;
- get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
+ get_rtaddrs(rtm->rtm_addrs, (struct sockaddr *)sa, rti_info);
printf("addr: ");
print_sa6(rti_info[RTAX_DST]);
@@ -62,7 +60,7 @@ void p_rtentry(struct rt_msghdr *rtm) {
int main() {
// sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
// const void *newp, size_t newlen);
- int needed;
+ unsigned int needed;
struct rt_msghdr *rtm;
struct sockaddr *sa;
char *buf,*next,*lim;
@@ -88,5 +86,5 @@ int main() {
free(buf);
buf = NULL;
}
-
+ return 0;
}