Store the port number in "fwd" rules in host format, same as ipfw1

has always done.

Technically, this is the wrong format, but it reduces the diffs in
-stable. Someday, when we get rid of ipfw1, I will put the port number
in the proper format both in kernel and userland.

MFC after: 3 days
(with re@ permission)
This commit is contained in:
luigi 2002-09-12 00:45:32 +00:00
parent 57de4fb945
commit 4eb7324870

View File

@ -908,7 +908,7 @@ show_ipfw(struct ip_fw *rule)
printf("fwd %s", inet_ntoa(s->sa.sin_addr));
if (s->sa.sin_port)
printf(",%d", ntohs(s->sa.sin_port));
printf(",%d", s->sa.sin_port);
}
break;
@ -2592,7 +2592,7 @@ add(int ac, char *av[])
if (s == end)
errx(EX_DATAERR,
"illegal forwarding port ``%s''", s);
p->sa.sin_port = htons( (u_short)i );
p->sa.sin_port = (u_short)i;
}
lookup_host(*av, &(p->sa.sin_addr));
}