From a2c0f0b4fb853a9cec69452a6f6324963492e863 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 19 Jan 2010 21:02:34 +0100 Subject: fix rb532 allmodconfig --- package/mdadm/patches/patch-Makefile | 14 ++++++- .../patch-src_detection-plugins_sp_ip_tos_check_c | 26 ++++++++++++ .../patch-src_detection-plugins_sp_pattern_match_c | 47 ++++++++++++++++++++++ .../patch-src_detection-plugins_sp_replace_c | 11 +++++ .../patch-src_detection-plugins_sp_tcp_win_check_c | 26 ++++++++++++ package/snort/patches/patch-src_log_c | 38 +++++++++++++++++ package/snort/patches/patch-src_log_text_c | 38 +++++++++++++++++ .../patch-src_output-plugins_spo_alert_unixsock_c | 28 +++++++++++++ package/snort/patches/patch-src_parser_IpAddrSet_c | 16 ++++++++ target/Config.in | 1 + target/linux/config/Config.in.bluetooth | 2 +- target/rb532/Makefile | 8 ++++ target/rb532/uclibc.config | 2 +- 13 files changed, 253 insertions(+), 4 deletions(-) create mode 100644 package/snort/patches/patch-src_detection-plugins_sp_ip_tos_check_c create mode 100644 package/snort/patches/patch-src_detection-plugins_sp_pattern_match_c create mode 100644 package/snort/patches/patch-src_detection-plugins_sp_replace_c create mode 100644 package/snort/patches/patch-src_detection-plugins_sp_tcp_win_check_c create mode 100644 package/snort/patches/patch-src_log_c create mode 100644 package/snort/patches/patch-src_log_text_c create mode 100644 package/snort/patches/patch-src_output-plugins_spo_alert_unixsock_c create mode 100644 package/snort/patches/patch-src_parser_IpAddrSet_c diff --git a/package/mdadm/patches/patch-Makefile b/package/mdadm/patches/patch-Makefile index 585f6730b..79b801c74 100644 --- a/package/mdadm/patches/patch-Makefile +++ b/package/mdadm/patches/patch-Makefile @@ -1,6 +1,16 @@ --- mdadm-3.0.orig/Makefile 2009-06-02 07:48:29.000000000 +0200 -+++ mdadm-3.0/Makefile 2009-12-11 19:01:17.000000000 +0100 -@@ -186,29 +186,36 @@ sha1.o : sha1.c sha1.h md5.h ++++ mdadm-3.0/Makefile 2010-01-16 09:36:14.000000000 +0100 +@@ -58,7 +58,8 @@ CONFFILE = $(SYSCONFDIR)/mdadm.conf + CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf + MAILCMD =/usr/sbin/sendmail -t + CONFFILEFLAGS = -DCONFFILE=\"$(CONFFILE)\" -DCONFFILE2=\"$(CONFFILE2)\" +-CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) ++CFLAGS ?= ++CFLAGS += $(CWFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) + + # If you want a static binary, you might uncomment these + # LDFLAGS = -static +@@ -186,29 +187,36 @@ sha1.o : sha1.c sha1.h md5.h $(CC) $(CFLAGS) -DHAVE_STDINT_H -o sha1.o -c sha1.c install : mdadm mdmon install-man install-udev diff --git a/package/snort/patches/patch-src_detection-plugins_sp_ip_tos_check_c b/package/snort/patches/patch-src_detection-plugins_sp_ip_tos_check_c new file mode 100644 index 000000000..f4462c208 --- /dev/null +++ b/package/snort/patches/patch-src_detection-plugins_sp_ip_tos_check_c @@ -0,0 +1,26 @@ +--- snort-2.8.5.2.orig/src/detection-plugins/sp_ip_tos_check.c 2009-05-07 00:28:33.000000000 +0200 ++++ snort-2.8.5.2/src/detection-plugins/sp_ip_tos_check.c 2010-01-19 19:58:18.000000000 +0100 +@@ -191,19 +191,19 @@ void ParseIpTos(char *data, OptTreeNode + ds_ptr->not_flag = 1; + } + +- if(index(data, (int) 'x') == NULL && index(data, (int)'X') == NULL) ++ if(strchr(data, (int) 'x') == NULL && strchr(data, (int)'X') == NULL) + { + ds_ptr->ip_tos = atoi(data); + } + else + { +- if(index(data,(int)'x')) ++ if(strchr(data,(int)'x')) + { +- ds_ptr->ip_tos = (u_char) strtol((index(data, (int)'x')+1), NULL, 16); ++ ds_ptr->ip_tos = (u_char) strtol((strchr(data, (int)'x')+1), NULL, 16); + } + else + { +- ds_ptr->ip_tos = (u_char) strtol((index(data, (int)'X')+1), NULL, 16); ++ ds_ptr->ip_tos = (u_char) strtol((strchr(data, (int)'X')+1), NULL, 16); + } + } + diff --git a/package/snort/patches/patch-src_detection-plugins_sp_pattern_match_c b/package/snort/patches/patch-src_detection-plugins_sp_pattern_match_c new file mode 100644 index 000000000..ff3f016da --- /dev/null +++ b/package/snort/patches/patch-src_detection-plugins_sp_pattern_match_c @@ -0,0 +1,47 @@ +--- snort-2.8.5.2.orig/src/detection-plugins/sp_pattern_match.c 2009-08-10 22:41:44.000000000 +0200 ++++ snort-2.8.5.2/src/detection-plugins/sp_pattern_match.c 2010-01-19 19:58:58.000000000 +0100 +@@ -831,7 +831,7 @@ void PayloadSearchListInit(char *data, O + data++; + + /* grab everything between the starting " and the end one */ +- sptr = index(data, '"'); ++ sptr = strchr(data, '"'); + eptr = strrchr(data, '"'); + + if(sptr != NULL && eptr != NULL) +@@ -862,21 +862,21 @@ static char *PayloadExtractParameter(cha + char *quote_one = NULL, *quote_two = NULL; + char *comma = NULL; + +- quote_one = index(data, '"'); ++ quote_one = strchr(data, '"'); + if (quote_one) + { +- quote_two = index(quote_one+1, '"'); ++ quote_two = strchr(quote_one+1, '"'); + while ( quote_two && quote_two[-1] == '\\' ) +- quote_two = index(quote_two+1, '"'); ++ quote_two = strchr(quote_two+1, '"'); + } + + if (quote_one && quote_two) + { +- comma = index(quote_two, ','); ++ comma = strchr(quote_two, ','); + } + else if (!quote_one) + { +- comma = index(data, ','); ++ comma = strchr(data, ','); + } + + if (comma) +@@ -2035,7 +2035,7 @@ void ParsePattern(char *rule, OptTreeNod + } + + /* find the start of the data */ +- start_ptr = index(rule, '"'); ++ start_ptr = strchr(rule, '"'); + + if(start_ptr != rule) + { diff --git a/package/snort/patches/patch-src_detection-plugins_sp_replace_c b/package/snort/patches/patch-src_detection-plugins_sp_replace_c new file mode 100644 index 000000000..e532b2ac1 --- /dev/null +++ b/package/snort/patches/patch-src_detection-plugins_sp_replace_c @@ -0,0 +1,11 @@ +--- snort-2.8.5.2.orig/src/detection-plugins/sp_replace.c 2009-07-07 17:37:04.000000000 +0200 ++++ snort-2.8.5.2/src/detection-plugins/sp_replace.c 2010-01-19 20:21:14.000000000 +0100 +@@ -122,7 +122,7 @@ static PatternMatchData * Replace_Parse( + } + + /* find the start of the data */ +- start_ptr = index(rule, '"'); ++ start_ptr = strchr(rule, '"'); + + if(start_ptr == NULL) + { diff --git a/package/snort/patches/patch-src_detection-plugins_sp_tcp_win_check_c b/package/snort/patches/patch-src_detection-plugins_sp_tcp_win_check_c new file mode 100644 index 000000000..c1df26aad --- /dev/null +++ b/package/snort/patches/patch-src_detection-plugins_sp_tcp_win_check_c @@ -0,0 +1,26 @@ +--- snort-2.8.5.2.orig/src/detection-plugins/sp_tcp_win_check.c 2009-05-07 00:28:39.000000000 +0200 ++++ snort-2.8.5.2/src/detection-plugins/sp_tcp_win_check.c 2010-01-19 20:06:29.000000000 +0100 +@@ -196,19 +196,19 @@ void ParseTcpWin(char *data, OptTreeNode + ds_ptr->not_flag = 1; + } + +- if(index(data, (int) 'x') == NULL && index(data, (int)'X') == NULL) ++ if(strchr(data, (int) 'x') == NULL && strchr(data, (int)'X') == NULL) + { + win_size = atoi(data); + } + else + { +- if(index(data,(int)'x')) ++ if(strchr(data,(int)'x')) + { +- win_size = (uint16_t) strtol((index(data, (int)'x')+1), NULL, 16); ++ win_size = (uint16_t) strtol((strchr(data, (int)'x')+1), NULL, 16); + } + else + { +- win_size = (uint16_t) strtol((index(data, (int)'X')+1), NULL, 16); ++ win_size = (uint16_t) strtol((strchr(data, (int)'X')+1), NULL, 16); + } + } + diff --git a/package/snort/patches/patch-src_log_c b/package/snort/patches/patch-src_log_c new file mode 100644 index 000000000..5f59a4ed0 --- /dev/null +++ b/package/snort/patches/patch-src_log_c @@ -0,0 +1,38 @@ +--- snort-2.8.5.2.orig/src/log.c 2009-10-19 17:48:42.000000000 +0200 ++++ snort-2.8.5.2/src/log.c 2010-01-19 20:01:42.000000000 +0100 +@@ -916,7 +916,7 @@ void PrintArpHeader(FILE * fp, Packet * + switch(ntohs(p->ah->ea_hdr.ar_op)) + { + case ARPOP_REQUEST: +- bcopy((void *)p->ah->arp_tpa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_tpa, sizeof(ip_addr)); + fprintf(fp, "ARP who-has %s", inet_ntoa(ip_addr)); + + if(memcmp((char *) ezero, (char *) p->ah->arp_tha, 6) != 0) +@@ -925,7 +925,7 @@ void PrintArpHeader(FILE * fp, Packet * + p->ah->arp_tha[1], p->ah->arp_tha[2], p->ah->arp_tha[3], + p->ah->arp_tha[4], p->ah->arp_tha[5]); + } +- bcopy((void *)p->ah->arp_spa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_spa, sizeof(ip_addr)); + + fprintf(fp, " tell %s", inet_ntoa(ip_addr)); + +@@ -938,7 +938,7 @@ void PrintArpHeader(FILE * fp, Packet * + break; + + case ARPOP_REPLY: +- bcopy((void *)p->ah->arp_spa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_spa, sizeof(ip_addr)); + fprintf(fp, "ARP reply %s", inet_ntoa(ip_addr)); + + /* print out the originating request if we're on a weirder +@@ -971,7 +971,7 @@ void PrintArpHeader(FILE * fp, Packet * + break; + + case ARPOP_RREPLY: +- bcopy((void *)p->ah->arp_tpa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_tpa, sizeof(ip_addr)); + fprintf(fp, "RARP reply %X:%X:%X:%X:%X:%X at %s", + p->ah->arp_tha[0], p->ah->arp_tha[1], p->ah->arp_tha[2], + p->ah->arp_tha[3], p->ah->arp_tha[4], p->ah->arp_tha[5], diff --git a/package/snort/patches/patch-src_log_text_c b/package/snort/patches/patch-src_log_text_c new file mode 100644 index 000000000..033608f9f --- /dev/null +++ b/package/snort/patches/patch-src_log_text_c @@ -0,0 +1,38 @@ +--- snort-2.8.5.2.orig/src/log_text.c 2009-05-07 00:28:15.000000000 +0200 ++++ snort-2.8.5.2/src/log_text.c 2010-01-19 20:00:30.000000000 +0100 +@@ -1604,7 +1604,7 @@ void LogArpHeader(TextLog* log, Packet * + switch(ntohs(p->ah->ea_hdr.ar_op)) + { + case ARPOP_REQUEST: +- bcopy((void *)p->ah->arp_tpa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_tpa, sizeof(ip_addr)); + TextLog_Print(log, "ARP who-has %s", inet_ntoa(ip_addr)); + + if(memcmp((char *) ezero, (char *) p->ah->arp_tha, 6) != 0) +@@ -1613,7 +1613,7 @@ void LogArpHeader(TextLog* log, Packet * + p->ah->arp_tha[1], p->ah->arp_tha[2], p->ah->arp_tha[3], + p->ah->arp_tha[4], p->ah->arp_tha[5]); + } +- bcopy((void *)p->ah->arp_spa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_spa, sizeof(ip_addr)); + + TextLog_Print(log, " tell %s", inet_ntoa(ip_addr)); + +@@ -1626,7 +1626,7 @@ void LogArpHeader(TextLog* log, Packet * + break; + + case ARPOP_REPLY: +- bcopy((void *)p->ah->arp_spa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_spa, sizeof(ip_addr)); + TextLog_Print(log, "ARP reply %s", inet_ntoa(ip_addr)); + + /* print out the originating request if we're on a weirder +@@ -1659,7 +1659,7 @@ void LogArpHeader(TextLog* log, Packet * + break; + + case ARPOP_RREPLY: +- bcopy((void *)p->ah->arp_tpa, (void *) &ip_addr, sizeof(ip_addr)); ++ memcpy((void *) &ip_addr, (void *)p->ah->arp_tpa, sizeof(ip_addr)); + TextLog_Print(log, "RARP reply %X:%X:%X:%X:%X:%X at %s", + p->ah->arp_tha[0], p->ah->arp_tha[1], p->ah->arp_tha[2], + p->ah->arp_tha[3], p->ah->arp_tha[4], p->ah->arp_tha[5], diff --git a/package/snort/patches/patch-src_output-plugins_spo_alert_unixsock_c b/package/snort/patches/patch-src_output-plugins_spo_alert_unixsock_c new file mode 100644 index 000000000..5b07072be --- /dev/null +++ b/package/snort/patches/patch-src_output-plugins_spo_alert_unixsock_c @@ -0,0 +1,28 @@ +--- snort-2.8.5.2.orig/src/output-plugins/spo_alert_unixsock.c 2009-05-07 00:29:12.000000000 +0200 ++++ snort-2.8.5.2/src/output-plugins/spo_alert_unixsock.c 2010-01-19 20:05:44.000000000 +0100 +@@ -179,13 +179,13 @@ void AlertUnixSock(Packet *p, char *msg, + bzero((char *)&alertpkt,sizeof(alertpkt)); + if (event) + { +- bcopy((const void *)event,(void *)&alertpkt.event,sizeof(Event)); ++ memcpy((void *)&alertpkt.event,(const void *)event,sizeof(Event)); + } + + if(p && p->pkt) + { +- bcopy((const void *)p->pkth,(void *)&alertpkt.pkth,sizeof(struct pcap_pkthdr)); +- bcopy((const void *)p->pkt,alertpkt.pkt, ++ memcpy((void *)&alertpkt.pkth,(const void *)p->pkth,sizeof(struct pcap_pkthdr)); ++ memcpy(alertpkt.pkt,(const void *)p->pkt, + alertpkt.pkth.caplen > SNAPLEN? SNAPLEN : alertpkt.pkth.caplen); + } + else +@@ -193,7 +193,7 @@ void AlertUnixSock(Packet *p, char *msg, + + if (msg) + { +- bcopy((const void *)msg,(void *)alertpkt.alertmsg, ++ memcpy((void *)alertpkt.alertmsg,(const void *)msg, + strlen(msg)>ALERTMSG_LENGTH-1 ? ALERTMSG_LENGTH - 1 : strlen(msg)); + } + diff --git a/package/snort/patches/patch-src_parser_IpAddrSet_c b/package/snort/patches/patch-src_parser_IpAddrSet_c new file mode 100644 index 000000000..edb62126d --- /dev/null +++ b/package/snort/patches/patch-src_parser_IpAddrSet_c @@ -0,0 +1,16 @@ +--- snort-2.8.5.2.orig/src/parser/IpAddrSet.c 2009-07-07 17:37:07.000000000 +0200 ++++ snort-2.8.5.2/src/parser/IpAddrSet.c 2010-01-19 20:20:50.000000000 +0100 +@@ -388,11 +388,11 @@ int ParseIP(char *paddr, IpAddrSet *ias, + /* protecting against malicious DNS servers */ + if(host_info->h_length <= (int)sizeof(sin.sin_addr)) + { +- bcopy(host_info->h_addr, (char *) &sin.sin_addr, host_info->h_length); ++ memcpy((char *) &sin.sin_addr, host_info->h_addr, host_info->h_length); + } + else + { +- bcopy(host_info->h_addr, (char *) &sin.sin_addr, sizeof(sin.sin_addr)); ++ memcpy((char *) &sin.sin_addr, host_info->h_addr, sizeof(sin.sin_addr)); + } + } + /* Using h_errno */ diff --git a/target/Config.in b/target/Config.in index 64ad4d616..2f2c7727e 100644 --- a/target/Config.in +++ b/target/Config.in @@ -548,6 +548,7 @@ config ADK_LINUX_MIPS_RB532 select ADK_KERNEL_NET_ETHERNET select ADK_KERNEL_MII select ADK_KERNEL_BLK_DEV_SD + select ADK_KERNEL_SCSI select ADK_TARGET_WITH_MINIPCI help Support for Mikrotik RB532. diff --git a/target/linux/config/Config.in.bluetooth b/target/linux/config/Config.in.bluetooth index 5597ec961..5f4dca821 100644 --- a/target/linux/config/Config.in.bluetooth +++ b/target/linux/config/Config.in.bluetooth @@ -1,5 +1,5 @@ menu "Bluetooth" -depends on ADK_TARGET_WITH_USB || ADK_TARGET_WITH_MINIPCI +depends on ADK_TARGET_WITH_USB config ADK_KPACKAGE_KMOD_BT prompt "kmod-bluetooth.................... Bluetooth drivers and network stack" diff --git a/target/rb532/Makefile b/target/rb532/Makefile index 7cf3d7c46..77a204a11 100644 --- a/target/rb532/Makefile +++ b/target/rb532/Makefile @@ -29,3 +29,11 @@ imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL) @echo 'Do not forget to create device nodes for console,null and tty in your nfsroot' @echo 'Login as user root with password linux123 via ssh or console' endif + +ifeq ($(FS),yaffs) +imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL) + @echo + @echo 'The kernel file is: ${BIN_DIR}/${ADK_TARGET}-${FS}-kernel' + @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL)," + @echo 'Login as user root with password linux123 via ssh or console' +endif diff --git a/target/rb532/uclibc.config b/target/rb532/uclibc.config index 9a6a88401..9a6a711be 100644 --- a/target/rb532/uclibc.config +++ b/target/rb532/uclibc.config @@ -126,7 +126,7 @@ UCLIBC_HAS_BSD_ERR=y # UCLIBC_NTP_LEGACY is not set # UCLIBC_SV4_DEPRECATED is not set UCLIBC_HAS_REALTIME=y -# UCLIBC_HAS_ADVANCED_REALTIME is not set +UCLIBC_HAS_ADVANCED_REALTIME=y UCLIBC_HAS_EPOLL=y UCLIBC_HAS_XATTR=y # UCLIBC_HAS_PROFILING is not set -- cgit v1.2.3