Browse Source

Merge branch 'freebsd/current/master' into hardened/current/master

* freebsd/current/master:
  OFED: Fix accidental double-copy of rdma_sdp.h in r351176
  simple_httpd was not buildable for some time due to multiple missing "static" keywords and -Werror,-Wmissing-variable-declarations
hardened/current/master
Oliver Pinter + 9 months ago
parent
commit
4768dfcd01
2 changed files with 27 additions and 105 deletions
  1. +27
    -27
      release/picobsd/tinyware/simple_httpd/simple_httpd.c
  2. +0
    -78
      sys/ofed/include/rdma/rdma_sdp.h

+ 27
- 27
release/picobsd/tinyware/simple_httpd/simple_httpd.c View File

@@ -48,33 +48,33 @@
#include <time.h>
#include <unistd.h>

int http_port = 80;
int daemonize = 1;
int verbose = 0;
int http_sock, con_sock;
const char *fetch_mode = NULL;
char homedir[100];
char logfile[80];
char *adate(void);
void init_servconnection(void);
void http_date(void);
void http_output(const char *html);
void http_request(void);
void log_line(char *req);
void wait_connection(void);
struct hostent *hst;
struct sockaddr_in source;
static int http_port = 80;
static int daemonize = 1;
static int verbose = 0;
static int http_sock, con_sock;
static const char *fetch_mode = NULL;
static char homedir[100];
static char logfile[80];
static char *adate(void);
static void init_servconnection(void);
static void http_date(void);
static void http_output(const char *html);
static void http_request(void);
static void log_line(char *req);
static void wait_connection(void);
static struct hostent *hst;
static struct sockaddr_in source;

/* HTTP basics */
static char httpd_server_ident[] = "Server: FreeBSD/PicoBSD simple_httpd 1.1\r";

static char http_200[] = "HTTP/1.0 200 OK\r";

const char *default_mime_type = "application/octet-stream";
static const char *default_mime_type = "application/octet-stream";

const char *mime_type[][2] = {
static const char *mime_type[][2] = {
{ "txt", "text/plain" },
{ "htm", "text/html" },
{ "html", "text/html" },
@@ -83,7 +83,7 @@ const char *mime_type[][2] = {
{ "mp3", "audio/mpeg" }
};

const int mime_type_max = sizeof(mime_type) / sizeof(mime_type[0]) - 1;
static const int mime_type_max = sizeof(mime_type) / sizeof(mime_type[0]) - 1;

/* Two parts, HTTP Header and then HTML */
static const char *http_404[2] =
@@ -101,7 +101,7 @@ This server only supports GET and HEAD requests.\n</BODY></HTML>\r\n"
/*
* Only called on initial invocation
*/
void
static void
init_servconnection(void)
{
struct sockaddr_in server;
@@ -125,7 +125,7 @@ init_servconnection(void)
/*
* Wait here until we see an incoming http request
*/
void
static void
wait_connection(void)
{
socklen_t lg;
@@ -142,7 +142,7 @@ wait_connection(void)
/*
* Print timestamp for HTTP HEAD and GET
*/
void
static void
http_date(void)
{
time_t tl;
@@ -157,7 +157,7 @@ http_date(void)
/*
* Send data to the open socket
*/
void
static void
http_output(const char *html)
{
write(con_sock, html, strlen(html));
@@ -169,7 +169,7 @@ http_output(const char *html)
* Create and write the log information to file
* Log file format is one line per entry
*/
void
static void
log_line(char *req)
{
char log_buff[256];
@@ -213,7 +213,7 @@ log_line(char *req)
* We have a connection. Identify what type of request GET, HEAD, CGI, etc
* and do what needs to be done
*/
void
static void
http_request(void)
{
int fd, lg, i;

+ 0
- 78
sys/ofed/include/rdma/rdma_sdp.h View File

@@ -78,81 +78,3 @@ struct sdp_hah {
} __packed;

#endif /* _SYS_OFED_INCLUDE_RDMA_RDMA_SDP_H_ */
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2019 Isilon Systems, LLC.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

#ifndef _SYS_OFED_INCLUDE_RDMA_RDMA_SDP_H_
#define _SYS_OFED_INCLUDE_RDMA_RDMA_SDP_H_

#include <sys/cdefs.h>
#include <netinet/in.h>

#include <rdma/ib_cm.h>

union cma_ip_addr {
struct in6_addr ip6;
struct {
__be32 pad[3];
__be32 addr;
} ip4;
};

struct sdp_bsdh {
u8 mid;
u8 flags;
__u16 bufs;
__u32 len;
__u32 mseq;
__u32 mseq_ack;
} __packed;

struct sdp_hh {
struct sdp_bsdh bsdh;
u8 majv_minv;
u8 ipv_cap;
u8 rsvd1;
u8 max_adverts;
__u32 desremrcvsz;
__u32 localrcvsz;
__u16 port;
__u16 rsvd2;
union cma_ip_addr src_addr;
union cma_ip_addr dst_addr;
u8 rsvd3[IB_CM_REQ_PRIVATE_DATA_SIZE - sizeof(struct sdp_bsdh) - 48];
} __packed;

struct sdp_hah {
struct sdp_bsdh bsdh;
u8 majv_minv;
u8 ipv_cap;
u8 rsvd1;
u8 ext_max_adverts;
__u32 actrcvsz;
u8 rsvd2[IB_CM_REP_PRIVATE_DATA_SIZE - sizeof(struct sdp_bsdh) - 8];
} __packed;

#endif /* _SYS_OFED_INCLUDE_RDMA_RDMA_SDP_H_ */

Loading…
Cancel
Save