fix build with clang6

This commit is contained in:
jasper 2018-04-12 17:55:08 +00:00
parent 7058096310
commit 1e5a67f986
8 changed files with 113 additions and 2 deletions

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-dronesource_cc,v 1.1 2018/04/12 17:55:08 jasper Exp $
Index: dronesource.cc
--- dronesource.cc.orig
+++ dronesource.cc
@@ -58,7 +58,7 @@ int DroneSource::OpenSource() {
local_sock.sin_addr.s_addr = htonl(INADDR_ANY);
local_sock.sin_port = htons(0);
- if (bind(drone_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) {
+ if (::bind(drone_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) {
snprintf(errstr, 1024, "bind() failed %d (%s)\n", errno, strerror(errno));
return (-3);
}

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-finitestate_cc,v 1.1 2018/04/12 17:55:08 jasper Exp $
Index: finitestate.cc
--- finitestate.cc.orig
+++ finitestate.cc
@@ -224,7 +224,7 @@ int BssTimestampAutomata::ProcessPacket(const packet_i
// Generate an alert, we're getting a bunch of invalid timestamps
snprintf(atext, STATUS_MAX, "Out-of-sequence BSS timestamp on %s "
- "- got %"PRIx64", expected %"PRIx64" - this could indicate AP spoofing",
+ "- got %" PRIx64 ", expected %" PRIx64 " - this could indicate AP spoofing",
in_info->bssid_mac.Mac2String().c_str(), in_info->timestamp,
elem->bss_timestamp);
atracker->RaiseAlert(alertid, in_info->bssid_mac, 0, 0, 0,

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-gpsd_cc,v 1.1 2018/04/12 17:55:08 jasper Exp $
Index: gpsd.cc
--- gpsd.cc.orig
+++ gpsd.cc
@@ -93,7 +93,7 @@ int GPSD::OpenGPSD() {
localaddr.sin_addr.s_addr = htonl(INADDR_ANY);
localaddr.sin_port = htons(0);
- if (bind(sock, (struct sockaddr *) &localaddr, sizeof(localaddr)) < 0) {
+ if (::bind(sock, (struct sockaddr *) &localaddr, sizeof(localaddr)) < 0) {
snprintf(errstr, 1024, "GPSD cannot bind port: %s", strerror(errno));
CloseGPSD();
return -1;

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-panelfront_display_cc,v 1.3 2018/04/12 17:55:08 jasper Exp $
Index: panelfront_display.cc
--- panelfront_display.cc.orig
+++ panelfront_display.cc
@@ -1712,7 +1712,7 @@ int PanelFront::DetailsPrinter(void *in_window) {
// Added by Sven-Ola, may need le64_to_cpu()? Also added the bss_tsf
// to the kismet tcp protocol used between client and server
- snprintf(output, print_width, "BSS Time: %"PRIx64"", dnet->bss_timestamp);
+ snprintf(output, print_width, "BSS Time: %" PRIx64 "", dnet->bss_timestamp);
kwin->text.push_back(output);
if (dnet->maxseenrate != 0) {

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-server_protocols_cc,v 1.1 2017/05/17 16:03:32 espie Exp $
$OpenBSD: patch-server_protocols_cc,v 1.2 2018/04/12 17:55:08 jasper Exp $
Index: server_protocols.cc
--- server_protocols.cc.orig
@ -130,3 +130,12 @@ Index: server_protocols.cc
"interface", "type", "username", "channel", "id", "packets", "hopping",
NULL
};
@@ -523,7 +523,7 @@ void Protocol_Network2Data(const wireless_network *net
snprintf(tmpstr, 128, "%d", net->dupeiv_packets);
data->ndvec.push_back(tmpstr);
- snprintf(tmpstr, 128, "%"PRId64"", net->bss_timestamp);
+ snprintf(tmpstr, 128, "%" PRId64 "", net->bss_timestamp);
data->ndvec.push_back(tmpstr);
}

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-tcpclient_cc,v 1.3 2018/04/12 17:55:08 jasper Exp $
Index: tcpclient.cc
--- tcpclient.cc.orig
+++ tcpclient.cc
@@ -129,7 +129,7 @@ int TcpClient::Connect(short int in_port, char *in_hos
local_sock.sin_addr.s_addr = htonl(INADDR_ANY);
local_sock.sin_port = htons(0);
- if (bind(client_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) {
+ if (::bind(client_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) {
snprintf(errstr, 1024, "FATAL: TcpClient bind() failed %d (%s)\n",
errno, strerror(errno));
return (-3);
@@ -408,7 +408,7 @@ int TcpClient::ParseData(char *in_data) {
"%d %d %d %d %d %d %d %d %d %hd.%hd.%hd.%hd "
"%d %f %f %f %f %f %f %f %f %d %d %d %f %d %d %d %d %d %d %d %d"
"%f %f %f %lf %lf %lf %ld %ld"
- "%d %d %d %d %d %d %d %d %"PRId64"",
+ "%d %d %d %d %d %d %d %d %" PRId64 "",
&tmptype, ssid, beaconstr,
&llc_packets, &data_packets, &crypt_packets,
&interesting_packets, &channel, &crypt_set,

View File

@ -1,8 +1,17 @@
$OpenBSD: patch-tcpserver_cc,v 1.3 2017/05/17 16:03:32 espie Exp $
$OpenBSD: patch-tcpserver_cc,v 1.4 2018/04/12 17:55:08 jasper Exp $
Index: tcpserver.cc
--- tcpserver.cc.orig
+++ tcpserver.cc
@@ -86,7 +86,7 @@ int TcpServer::Setup(unsigned int in_max_clients, stri
// Bind the named socket
// Debug("Server::Setup calling bind()");
- if (bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) {
+ if (::bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) {
snprintf(errstr, 1024, "TcpServer bind() failed: %s", strerror(errno));
return (-5);
}
@@ -567,7 +567,7 @@ int TcpServer::SendMainProtocols(int in_fd, int in_ref
return SendToClient(in_fd, in_ref, (void *) &protocol_map);
}

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-tcpstreamer_cc,v 1.3 2018/04/12 17:55:08 jasper Exp $
Index: tcpstreamer.cc
--- tcpstreamer.cc.orig
+++ tcpstreamer.cc
@@ -87,7 +87,7 @@ int TcpStreamer::Setup(unsigned int in_max_clients, st
// Bind the named socket
// Debug("Server::Setup calling bind()");
- if (bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) {
+ if (::bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) {
snprintf(errstr, 1024, "TcpStreamer bind() failed: %s", strerror(errno));
return (-5);
}