|
|
@@ -265,7 +265,7 @@ int send_users(int fd) {
|
|
|
int vcc_new_msg(int fd, struct vcc_request *req) {
|
|
|
struct klist_node *n = find_connection(fd);
|
|
|
char *msg;
|
|
|
- int sid;
|
|
|
+ int sid, magic;
|
|
|
|
|
|
if (unlikely(!n))
|
|
|
return 1;
|
|
|
@@ -278,6 +278,14 @@ int vcc_new_msg(int fd, struct vcc_request *req) {
|
|
|
* f**k.
|
|
|
* */
|
|
|
|
|
|
+ magic = ntohl(req->magic);
|
|
|
+
|
|
|
+ if (magic != VCC_MAGIC || magic != VCC_MAGIC_RL) {
|
|
|
+ vcc_log("--- bad magic from %d. \n", fd);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
switch (htonl(req->reqtype)) {
|
|
|
case REQ_MSG_NEW:
|
|
|
/* POLLOUT will be set, just because they sent us a message */
|