Switch shells/nsh to fetching from github, which has most of our patches
rolled in. (Build currently fails due to noinet6 changes, this change doesn't fix this yet).
This commit is contained in:
parent
576f7fd416
commit
ca1e359591
@ -1,9 +1,13 @@
|
||||
# $OpenBSD: Makefile,v 1.8 2014/07/05 10:03:05 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.9 2015/01/10 12:00:07 sthen Exp $
|
||||
|
||||
COMMENT = network switch style shell
|
||||
|
||||
DISTNAME = nsh-1.0
|
||||
REVISION = 4
|
||||
DISTNAME = nsh-1.0.20140503
|
||||
|
||||
GH_ACCOUNT = yellowman
|
||||
GH_PROJECT = nsh
|
||||
GH_COMMIT = 17aad6edd4ad4b0a7f4f281aa575490cbe68606a
|
||||
WRKDIST = ${WRKDIR}/nsh-${GH_COMMIT}
|
||||
|
||||
CATEGORIES = shells net
|
||||
HOMEPAGE = http://www.nmedia.net/nsh/
|
||||
@ -13,8 +17,7 @@ PERMIT_PACKAGE_CDROM = Yes
|
||||
|
||||
WANTLIB += c edit termcap sqlite3
|
||||
|
||||
MASTER_SITES = ftp://ftp.nmedia.net/pub/nsh/
|
||||
WRKDIST = ${WRKDIR}/nsh
|
||||
#MASTER_SITES = ftp://ftp.nmedia.net/pub/nsh/
|
||||
MAKE_FLAGS = CC="${CC}"
|
||||
|
||||
do-install:
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (nsh-1.0.tar.gz) = nxDVAkO0J9yRlIpCp6U+gd3JvOBLhP1WaVby7Mk3800=
|
||||
SIZE (nsh-1.0.tar.gz) = 171020
|
||||
SHA256 (nsh-1.0.20140503.tar.gz) = /WfEWuIj4qzW/RrVtsFAkYg91kJJbAwsyGWHmKSsU6k=
|
||||
SIZE (nsh-1.0.20140503.tar.gz) = 122697
|
||||
|
@ -1,21 +0,0 @@
|
||||
$OpenBSD: patch-conf_c,v 1.3 2013/11/27 14:14:22 jca Exp $
|
||||
--- conf.c.orig Tue Nov 26 16:32:01 2013
|
||||
+++ conf.c Tue Nov 26 16:32:10 2013
|
||||
@@ -746,11 +746,12 @@ void conf_ifmetrics(FILE *output, int ifs, struct if_d
|
||||
* ignore interfaces named "pfsync" since their mtu
|
||||
* is dynamic and controlled by the kernel
|
||||
*/
|
||||
- if (!MIN_ARG(ifname, "pfsync") && (if_mtu != default_mtu(ifname) &&
|
||||
- default_mtu(ifname) != MTU_IGNORE) && if_mtu != 0)
|
||||
- fprintf(output, " mtu %u\n", if_mtu);
|
||||
- if (if_metric)
|
||||
- fprintf(output, " metric %u\n", if_metric);
|
||||
+ if (!MIN_ARG(ifname, "pfsync") &&
|
||||
+ (if_data.ifi_mtu != default_mtu(ifname) &&
|
||||
+ default_mtu(ifname) != MTU_IGNORE) && if_data.ifi_mtu != 0)
|
||||
+ fprintf(output, " mtu %u\n", if_data.ifi_mtu);
|
||||
+ if (if_data.ifi_metric)
|
||||
+ fprintf(output, " metric %u\n", if_data.ifi_metric);
|
||||
|
||||
if (get_nwinfo(ifname, tmpc, TMPSIZ, NWID) != 0) {
|
||||
fprintf(output, " nwid %s\n", tmpc);
|
@ -1,113 +0,0 @@
|
||||
$OpenBSD: patch-if_c,v 1.4 2014/01/29 16:26:17 naddy Exp $
|
||||
--- if.c.orig Sun Feb 10 19:36:49 2013
|
||||
+++ if.c Tue Jan 28 23:56:58 2014
|
||||
@@ -170,9 +170,9 @@ show_int(int argc, char **argv)
|
||||
printf(" %s is %s", br ? "Bridge" : "Interface",
|
||||
flags & IFF_UP ? "up" : "down");
|
||||
|
||||
- if (if_lastchange.tv_sec) {
|
||||
+ if (if_data.ifi_lastchange.tv_sec) {
|
||||
gettimeofday(&tv, (struct timezone *)0);
|
||||
- c = difftime(tv.tv_sec, if_lastchange.tv_sec);
|
||||
+ c = difftime(tv.tv_sec, if_data.ifi_lastchange.tv_sec);
|
||||
days = c / SECSPERDAY;
|
||||
c %= SECSPERDAY;
|
||||
hours = c / SECSPERHOUR;
|
||||
@@ -182,13 +182,13 @@ show_int(int argc, char **argv)
|
||||
printf(" (last change ");
|
||||
if (days)
|
||||
printf("%id ", days);
|
||||
- printf("%02i:%02i:%02i)", hours, mins, c);
|
||||
+ printf("%02i:%02i:%02i)", hours, mins, (int)c);
|
||||
}
|
||||
|
||||
printf(", protocol is %s", flags & IFF_RUNNING ? "up" : "down");
|
||||
printf("\n");
|
||||
|
||||
- type = iftype(if_type);
|
||||
+ type = iftype(if_data.ifi_type);
|
||||
|
||||
printf(" Interface type %s", type);
|
||||
if (flags & IFF_BROADCAST)
|
||||
@@ -305,16 +305,17 @@ show_int(int argc, char **argv)
|
||||
/*
|
||||
* Display MTU, line rate
|
||||
*/
|
||||
- printf(" MTU %u bytes", if_mtu);
|
||||
+ printf(" MTU %u bytes", if_data.ifi_mtu);
|
||||
if (ioctl(ifs, SIOCGIFHARDMTU, (caddr_t)&ifr) != -1) {
|
||||
if (ifr.ifr_hardmtu)
|
||||
printf(" (hardmtu %u)", ifr.ifr_hardmtu);
|
||||
}
|
||||
- if (if_baudrate)
|
||||
+ if (if_data.ifi_baudrate)
|
||||
printf(", Line Rate %qu %s\n",
|
||||
- MBPS(if_baudrate) ? MBPS(if_baudrate) :
|
||||
- if_baudrate / 1000,
|
||||
- MBPS(if_baudrate) ? "Mbps" : "Kbps");
|
||||
+ MBPS(if_data.ifi_baudrate) ?
|
||||
+ MBPS(if_data.ifi_baudrate) :
|
||||
+ if_data.ifi_baudrate / 1000,
|
||||
+ MBPS(if_data.ifi_baudrate) ? "Mbps" : "Kbps");
|
||||
else
|
||||
printf("\n");
|
||||
|
||||
@@ -342,25 +343,30 @@ show_int(int argc, char **argv)
|
||||
* Display remaining info from if_data structure
|
||||
*/
|
||||
printf(" %qu packets input, %qu bytes, %qu errors, %qu drops\n",
|
||||
- if_ipackets, if_ibytes, if_ierrors, if_iqdrops);
|
||||
+ if_data.ifi_ipackets, if_data.ifi_ibytes, if_data.ifi_ierrors,
|
||||
+ if_data.ifi_iqdrops);
|
||||
printf(" %qu packets output, %qu bytes, %qu errors, %qu unsupported\n",
|
||||
- if_opackets, if_obytes, if_oerrors, if_noproto);
|
||||
- if (if_ibytes && if_ipackets && (if_ibytes / if_ipackets) >= ETHERMIN) {
|
||||
+ if_data.ifi_opackets, if_data.ifi_obytes, if_data.ifi_oerrors,
|
||||
+ if_data.ifi_noproto);
|
||||
+ if (if_data.ifi_ibytes && if_data.ifi_ipackets &&
|
||||
+ (if_data.ifi_ibytes / if_data.ifi_ipackets) >= ETHERMIN) {
|
||||
/* < ETHERMIN means byte counter probably rolled over */
|
||||
- printf(" %qu input", if_ibytes / if_ipackets);
|
||||
+ printf(" %qu input", if_data.ifi_ibytes /
|
||||
+ if_data.ifi_ipackets);
|
||||
pntd = 1;
|
||||
} else
|
||||
pntd = 0;
|
||||
- if (if_obytes && if_opackets && (if_obytes / if_opackets) >= ETHERMIN) {
|
||||
+ if (if_data.ifi_obytes && if_data.ifi_opackets &&
|
||||
+ (if_data.ifi_obytes / if_data.ifi_opackets) >= ETHERMIN) {
|
||||
/* < ETHERMIN means byte counter probably rolled over */
|
||||
printf("%s%qu output", pntd ? ", " : " ",
|
||||
- if_obytes / if_opackets);
|
||||
+ if_data.ifi_obytes / if_data.ifi_opackets);
|
||||
pntd = 1;
|
||||
}
|
||||
if (pntd)
|
||||
printf(" (average bytes/packet)\n");
|
||||
|
||||
- switch(if_type) {
|
||||
+ switch(if_data.ifi_type) {
|
||||
/*
|
||||
* These appear to be the only interface types to increase collision
|
||||
* count in the OpenBSD 3.2 kernel.
|
||||
@@ -369,7 +375,7 @@ show_int(int argc, char **argv)
|
||||
case IFT_SLIP:
|
||||
case IFT_PROPVIRTUAL:
|
||||
case IFT_IEEE80211:
|
||||
- printf(" %qu collisions\n", if_collisions);
|
||||
+ printf(" %qu collisions\n", if_data.ifi_collisions);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -524,9 +530,9 @@ get_ifdata(char *ifname, int type)
|
||||
ifr.ifr_data = (caddr_t)&if_data;
|
||||
if (ioctl(ifs, SIOCGIFDATA, (caddr_t)&ifr) == 0) {
|
||||
if (type == IFDATA_MTU)
|
||||
- value = if_mtu;
|
||||
+ value = if_data.ifi_mtu;
|
||||
else if (type == IFDATA_BAUDRATE)
|
||||
- value = if_baudrate;
|
||||
+ value = if_data.ifi_baudrate;
|
||||
}
|
||||
close(ifs);
|
||||
return (value);
|
@ -1,12 +0,0 @@
|
||||
$OpenBSD: patch-kroute_c,v 1.1 2014/01/29 16:26:17 naddy Exp $
|
||||
--- kroute.c.orig Sun Feb 10 19:36:49 2013
|
||||
+++ kroute.c Tue Jan 28 20:59:30 2014
|
||||
@@ -479,7 +479,7 @@ print_getmsg(rtm, msglen)
|
||||
printf("\thopcount:\t%u\n", rtm->rtm_rmx.rmx_hopcount);
|
||||
if (rtm->rtm_rmx.rmx_expire) {
|
||||
rtm->rtm_rmx.rmx_expire -= time(0);
|
||||
- printf("\texpires:\t%u sec\n", rtm->rtm_rmx.rmx_expire);
|
||||
+ printf("\texpires:\t%lld sec\n", rtm->rtm_rmx.rmx_expire);
|
||||
}
|
||||
|
||||
#define RTA_IGN (RTA_DST|RTA_GATEWAY|RTA_NETMASK|RTA_IFP|RTA_IFA|RTA_BRD)
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-stats_c,v 1.3 2014/08/24 20:29:08 landry Exp $
|
||||
--- stats.c.orig Sun Feb 10 19:36:49 2013
|
||||
+++ stats.c Sun Aug 24 22:27:36 2014
|
||||
$OpenBSD: patch-stats_c,v 1.4 2015/01/10 12:00:07 sthen Exp $
|
||||
--- stats.c.orig Sat May 3 22:50:07 2014
|
||||
+++ stats.c Sat Jan 10 11:57:38 2015
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/protosw.h>
|
||||
@ -18,47 +18,7 @@ $OpenBSD: patch-stats_c,v 1.3 2014/08/24 20:29:08 landry Exp $
|
||||
|
||||
#ifdef INET6
|
||||
char *inet6name(struct in6_addr *);
|
||||
@@ -132,7 +133,7 @@ tcp_stats()
|
||||
p(tcps_sndprobe, "\t\t%u window probe packet%s\n");
|
||||
p(tcps_sndwinup, "\t\t%u window update packet%s\n");
|
||||
p(tcps_sndctrl, "\t\t%u control packet%s\n");
|
||||
- p(tcps_outhwcsum, "\t\t%u packet%s hardware-checksummed\n");
|
||||
+ p(tcps_outswcsum, "\t\t%u packet%s software-checksummed\n");
|
||||
p(tcps_rcvtotal, "\t%u packet%s received\n");
|
||||
p2(tcps_rcvackpack, tcps_rcvackbyte, "\t\t%u ack%s (for %qd byte%s)\n");
|
||||
p(tcps_rcvdupack, "\t\t%u duplicate ack%s\n");
|
||||
@@ -157,7 +158,7 @@ tcp_stats()
|
||||
p1(tcps_rcvshort, "\t\t%u discarded because packet too short\n");
|
||||
p1(tcps_rcvnosec, "\t\t%u discarded for missing IPsec protection\n");
|
||||
p1(tcps_rcvmemdrop, "\t\t%u discarded due to memory shortage\n");
|
||||
- p(tcps_inhwcsum, "\t\t%u packet%s hardware-checksummed\n");
|
||||
+ p(tcps_inswcsum, "\t\t%u packet%s software-checksummed\n");
|
||||
p(tcps_rcvbadsig, "\t\t%u bad/missing md5 checksum%s\n");
|
||||
p(tcps_rcvgoodsig, "\t\t%qd good md5 checksum%s\n");
|
||||
p(tcps_connattempt, "\t%u connection request%s\n");
|
||||
@@ -249,8 +250,8 @@ udp_stats()
|
||||
p1(udps_badlen, "\t%lu with bad data length field\n");
|
||||
p1(udps_badsum, "\t%lu with bad checksum\n");
|
||||
p1(udps_nosum, "\t%lu with no checksum\n");
|
||||
- p(udps_inhwcsum, "\t%lu input packet%s hardware-checksummed\n");
|
||||
- p(udps_outhwcsum, "\t%lu output packet%s hardware-checksummed\n");
|
||||
+ p(udps_inswcsum, "\t%lu input packet%s software-checksummed\n");
|
||||
+ p(udps_outswcsum, "\t%lu output packet%s software-checksummed\n");
|
||||
p1(udps_noport, "\t%lu dropped due to no socket\n");
|
||||
p(udps_noportbcast, "\t%lu broadcast/multicast datagram%s dropped due to no socket\n");
|
||||
p1(udps_nosec, "\t%lu dropped due to missing IPsec protection\n");
|
||||
@@ -323,8 +324,8 @@ ip_stats()
|
||||
p(ips_toolong, "\t%lu packet%s with ip length > max ip packet size\n");
|
||||
p(ips_nogif, "\t%lu tunneling packet%s that can't find gif\n");
|
||||
p(ips_badaddr, "\t%lu datagram%s with bad address in header\n");
|
||||
- p(ips_inhwcsum, "\t%lu input datagram%s checksum-processed by hardware\n");
|
||||
- p(ips_outhwcsum, "\t%lu output datagram%s checksum-processed by hardware\n");
|
||||
+ p(ips_inswcsum, "\t%lu input datagram%s software-checksummed\n");
|
||||
+ p(ips_outswcsum, "\t%lu output datagram%s software-checksummed\n");
|
||||
p(ips_notmember, "\t%lu multicast packet%s which we don't join\n");
|
||||
#undef p
|
||||
#undef p1
|
||||
@@ -788,7 +789,7 @@ mbpr(void)
|
||||
@@ -776,7 +777,7 @@ mbpr(void)
|
||||
int totmem, totused, totmbufs, totpct;
|
||||
int i, mib[4], npools, flag = 0;
|
||||
bool seen[256];
|
||||
@ -67,7 +27,7 @@ $OpenBSD: patch-stats_c,v 1.3 2014/08/24 20:29:08 landry Exp $
|
||||
struct mbtypes *mp;
|
||||
size_t size;
|
||||
int page_size = getpagesize();
|
||||
@@ -825,7 +826,7 @@ mbpr(void)
|
||||
@@ -813,7 +814,7 @@ mbpr(void)
|
||||
mib[1] = KERN_POOL;
|
||||
mib[2] = KERN_POOL_POOL;
|
||||
mib[3] = i;
|
||||
@ -76,7 +36,7 @@ $OpenBSD: patch-stats_c,v 1.3 2014/08/24 20:29:08 landry Exp $
|
||||
if (sysctl(mib, 4, &pool, &size, NULL, 0) < 0) {
|
||||
if (errno == ENOENT)
|
||||
continue;
|
||||
@@ -843,12 +844,12 @@ mbpr(void)
|
||||
@@ -831,12 +832,12 @@ mbpr(void)
|
||||
}
|
||||
|
||||
if (!strncmp(name, "mbpl", strlen("mbpl"))) {
|
||||
|
@ -1,12 +0,0 @@
|
||||
$OpenBSD: patch-sysctl_c,v 1.1 2013/11/27 14:14:22 jca Exp $
|
||||
--- sysctl.c.orig Tue Nov 26 16:32:26 2013
|
||||
+++ sysctl.c Tue Nov 26 16:32:47 2013
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#define MIB_STOP INT_MAX
|
||||
|
||||
+#define IFQ_MAXLEN 256
|
||||
+
|
||||
void conf_sysctl(FILE *, char *, struct ipsysctl *);
|
||||
|
||||
/*
|
@ -1,14 +0,0 @@
|
||||
$OpenBSD: patch-utils_c,v 1.1 2014/01/29 16:26:17 naddy Exp $
|
||||
--- utils.c.orig Sun Feb 10 19:36:49 2013
|
||||
+++ utils.c Tue Jan 28 21:17:43 2014
|
||||
@@ -88,8 +88,8 @@ format_time(time_t seconds)
|
||||
} else {
|
||||
/* standard method produces MMM:SS */
|
||||
/* we avoid printf as must as possible to make this quick */
|
||||
- snprintf(result, sizeof(result), "%3d:%02d", seconds / 60,
|
||||
- seconds % 60);
|
||||
+ snprintf(result, sizeof(result), "%3d:%02d", (int)seconds / 60,
|
||||
+ (int)seconds % 60);
|
||||
}
|
||||
return (result);
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
$OpenBSD: patch-version_c,v 1.1 2014/01/29 16:26:17 naddy Exp $
|
||||
--- version.c.orig Sun Feb 10 19:36:49 2013
|
||||
+++ version.c Wed Jan 29 00:00:05 2014
|
||||
@@ -127,7 +127,7 @@ version(int argc, char **argv)
|
||||
pntd = 1;
|
||||
}
|
||||
if (!pntd)
|
||||
- printf("%d second%s", c, c == 1 ? "" : "s");
|
||||
+ printf("%d second%s", (int)c, c == 1 ? "" : "s");
|
||||
printf("\n");
|
||||
printf("system: %s/%s version %s\n", un.sysname, un.machine,
|
||||
un.release);
|
@ -1,14 +0,0 @@
|
||||
$OpenBSD: patch-who_c,v 1.1 2014/01/29 16:26:17 naddy Exp $
|
||||
--- who.c.orig Sun Feb 10 19:36:49 2013
|
||||
+++ who.c Tue Jan 28 21:17:17 2014
|
||||
@@ -114,8 +114,8 @@ output(struct utmp *up)
|
||||
(void)printf("00:00 ");
|
||||
else if (idle < (24 * 60 * 60))
|
||||
(void)printf("%02d:%02d ",
|
||||
- (idle / (60 * 60)),
|
||||
- (idle % (60 * 60)) / 60);
|
||||
+ ((int)idle / (60 * 60)),
|
||||
+ ((int)idle % (60 * 60)) / 60);
|
||||
else
|
||||
(void)printf(" old ");
|
||||
|
Loading…
Reference in New Issue
Block a user